Commit Graph

143 Commits

Author SHA1 Message Date
Alexander Langer
09bb0da60c Modify the return values to comply with POSIX. Previously these
functions would return -1 and set errno to indicate the specific error.
POSIX requires that the functions return the error code as the return
value of the function instead.
1997-11-25 01:29:16 +00:00
Alexander Langer
3234f7c1cc Added missing source file uthread_sigwait.c.
Submitted by:	Daniel M. Eischen <deischen@iworks.InterWorks.org>
1997-11-24 23:04:29 +00:00
Alexander Langer
666dfc8237 Correct the return value from pthread_cond_timedwait when a timeout
occurs (was EAGAIN, is now ETIMEDOUT).

Submitted by:	Daniel M. Eischen <deischen@iworks.InterWorks.org>
1997-11-23 22:58:26 +00:00
John Birrell
f4084c0544 Bring back nanosleep from the cold.
The addition of the nanosleep syscall was correctly added to
libc/sys/Makefile so that it is renamed as _thread_sys_nanosleep().
This syscall is one of those that libc_r has to re-implement because
the only behaviour is to block the process. So libc_r just ignores the
fact that a nanosleep syscall exists and goes its own way - as it has
done all along .... and now it does again. And now a simple program
can sleep again. Phew.
1997-06-04 13:03:12 +00:00
Alexander Langer
9c49eac672 Fixed overallocation of _thread_fd_table.
PR:		3494
Submitted by:	Steve Bauer <sbauer@rock.sdsmt.edu>
1997-05-13 23:54:22 +00:00
Peter Wemm
a8320cdfe5 Add const in the thread version of nanosleep()'s args 1997-05-12 10:02:18 +00:00
Peter Wemm
757d77dcf5 remove prototype for nanosleep(), it's visible in unistd.h now. 1997-05-12 10:00:46 +00:00
John Polstra
e91cc88467 Bye bye CPLUSPLUSLIB hack! It's not needed any more.
Don't merge this into -2.2 unless you understand the dependencies on
c++rt0, bsd.lib.mk, and gcc -shared.  I.e., let me do it.
1997-05-06 00:49:36 +00:00
John Birrell
9e19b4c525 Nuke makefiles that duplicate those in libc now that libc is libc_r
aware. This simplifies things for libc_r.
1997-05-03 04:05:57 +00:00
John Birrell
7f351fbb21 Use libc makefiles from now on instead of duplicating them in libc_r.
Added Id strings too. It's useful to know who last made a change.
1997-05-03 03:57:21 +00:00
John Birrell
8253a7d685 Set wakeup time in pthread_cond_wait() to `forever' (-1) to prevent
calling thread from being rescheduled based on an unspecified wakeup
time.

Bug/fix pointed out by Alexandre Fenyo <fenyo@email.enst.fr>.
1997-04-11 22:38:22 +00:00
John Birrell
38d7083fcf Fix the return value. Oops. 1997-04-01 22:52:43 +00:00
John Birrell
1cec64c4d6 Fix indentations. Sigh. 1997-04-01 22:51:48 +00:00
John Birrell
745a12fc30 Make error checking less zealous to handle devices like /dev/null
which don't provide a non-blocking interface.

This is a short term "fix" which changes a half-lose to a half-win.
The thread that accesses a device that does not provide a non-blocking
interface will block for its time slice.

A medium term solution would be to use rfork. A long-term solution
would be some sort of kernel thread/SMP implementation.
1997-04-01 22:49:58 +00:00
John Birrell
e710f8d85b Add parentheses to make blocking mode work. 1997-04-01 22:44:18 +00:00
Peter Wemm
7e546392b5 Revert $FreeBSD$ to $Id$ 1997-02-22 15:12:41 +00:00
Julian Elischer
c840cec7c5 Submitted by: John Birrell
uthreads update from the author.
1997-02-05 23:26:09 +00:00
Wolfram Schneider
75141cc987 Sort cross references. 1997-01-20 23:23:22 +00:00
Jordan K. Hubbard
1130b656e5 Make the long-awaited change from $Id$ to $FreeBSD$
This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore.  This update would have been
insane otherwise.
1997-01-14 07:20:47 +00:00
Bill Paul
1e6c86d048 Unspam this file: replace spaces with tabs so make doesn't barf. (I smell
a cut & paste-o.)

Noticed by: Ron Bolin <rlb@mindspring.com>
1996-12-29 16:32:21 +00:00
Alexander Langer
c65976619e Sync with libc.
Submitted by:	John Birrell <jb@cimlogic.com.au>
1996-12-29 03:04:08 +00:00
Alexander Langer
d0c9b2a226 Added uthread_attr_destroy.c to SRCS.
Submitted by:	John Birrell <jb@cimlogic.com.au>
1996-12-29 02:51:55 +00:00
Jeffrey Hsu
9144f05e36 Add pthread_mutexattr_init() and pthread_mutexattr_setkind_np(). 1996-11-11 09:09:30 +00:00
Jeffrey Hsu
d8fadc0e80 Add uthread_attr_init.c, uthread_attr_setstacksize.c, uthread_mattr_init.c,
uthread_mattr_kind_np.c, uthread_multi_np.c, and uthread_single_np.c.
1996-11-11 09:08:11 +00:00
Jeffrey Hsu
509de77c10 Moved enum pthread_mutextype to pthread.h.
Add pthread_mutexattr_default definition.
1996-11-11 09:07:05 +00:00
Jeffrey Hsu
f258836a24 Make pthread_getspecific() compliant with the final IEEE pthreads
specification:  return parameter passing changed.
1996-11-11 09:05:29 +00:00
Wolfram Schneider
e0e5145ce6 add missing comma(s) in .Xr macros 1996-09-23 22:24:39 +00:00
Wolfram Schneider
374fc79d70 fix .Xr macro 1996-09-21 15:08:10 +00:00
Nate Williams
ae0baddec3 Remove now un-necessary FreeBSD specific code since our timespec
structure now has the correct member names.

Pointed out by: Peter Wemm
1996-09-20 06:33:54 +00:00
Peter Wemm
c5c39d241c - libc self contained again.
- sync up source files with main libc
1996-08-30 21:26:05 +00:00
Adam David
93ae833698 pick up the resolver sources from contrib 1996-08-30 20:51:09 +00:00
Peter Wemm
c5c878699b cmp -s || install -c ==> install -C 1996-08-30 01:51:09 +00:00
Peter Wemm
1d4b71eaa3 Don't create/install libc_r_pic.a 1996-08-30 01:43:15 +00:00
Julian Elischer
5eaf55414c Submitted by: john birell (jb@cimlogic.com.au)
fixups for makefiles
and for Thread-safe sycalls
1996-08-22 04:25:09 +00:00
Julian Elischer
0f7d684755 Submitted by: John Birrell <cimaxp1!jb@werple.net.au>
Here are the diffs for libc_r to get it one step closer to P1003.1c
These make most of the thread/mutex/condvar structures opaque to the
user. There are three functions which have been renamed with _np
suffixes because they are extensions to P1003.1c (I did them for JAVA,
which needs to suspend/resume threads and also start threads suspended).

I've created a new header (pthread_np.h) for the non-POSIX stuff.

The egrep tags stuff in /usr/src/lib/libc_r/Makefile that I uncommented
doesn't work. I think its best to delete it. I don't think libc_r needs
tags anyway, 'cause most of the source is in libc which does have tags.

also:

Here's the first batch of man pages for the thread functions.
The diff to /usr/src/lib/libc_r/Makefile removes some stuff that was
inherited from /usr/src/lib/libc/Makefile that should only be done with
libc.

also:

I should have sent this diff with the pthread(3) man page.
It allows people to type

make -DWANT_LIBC_R world

to get libc_r built with the rest of the world. I put this in the
pthread(3) man page.  The default is still not to build libc_r.


also:
The diff attached adds a pthread(3) man page to /usr/src/share/man/man3.
The idea is that without libc_r installed, this man page will give people
enough info to know that they have to build libc_r.
1996-08-20 08:22:01 +00:00
Andrey A. Chernov
298f0ef3a2 Add collate_range_cmp 1996-08-13 14:55:09 +00:00
Wolfram Schneider
9fb933075e `mv'' -> `mv -f''
``rm'' -> ``rm -f''
so mv/rm may not ask for confirmation if you are not root
1996-05-07 23:19:49 +00:00
Peter Wemm
5437a8234c Sync libc_r with libc changes.. 1996-05-05 08:22:20 +00:00
Julian Elischer
5661849d54 keep the libc_r makefiles in step with those from libc
There needs to be a better way of doing this..
preferably we could add another pass to the
normal libc makefiles to do _r versions as well as _p versions
1996-03-20 03:05:34 +00:00
John Polstra
82d29a82b5 Added a new module "uthread_autoinit.cc". This is a small C++ module.
It uses a static constructor to call _thread_init() at program start-up
time.  That eliminates the need for any initialization hooks in crt0.o.

Added a symbol reference in "uthread_init.c", to ensure that the new
module will always be pulled in when the archive version of the library
is used.

In "Makefile.inc", defined CPLUSPLUSLIB, so that the constructor will be
properly invoked in the shared library.

Suggested by: Christopher Provenzano, Peter Wemm, and others.
1996-02-17 02:19:37 +00:00
John Polstra
7732e08227 Removed "iso_addr.c" from the Makefile. Support for it has been removed
from the system, and a required include file no longer exists.
1996-02-17 02:12:47 +00:00
Julian Elischer
6b2590e7ca error handling for threaded apps 1996-01-22 00:26:12 +00:00
Julian Elischer
012dfd00b3 Reviewed by: julian
Submitted by:	 john birrel

One version of the pthreads library
another will follow with differnt actions under some cases..
not QUITE complete
1996-01-22 00:23:58 +00:00