summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen/popen.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove unused variable: omask.tjr2003-01-041-1/+0
|
* Protect pidlist with a mutex to avoid a race causing a duplicate free()tjr2003-01-031-8/+24
| | | | | | | when the same pipe FILE is pclosed()'d in different threads, and to avoid corrupting the linked list when adding or removing items. The symptoms of the linked list getting corrupted were pclose() either not finding the pipe on the list, or the list becoming circular and pclose() looping infinitely.
* * Remove 'register'. (some functions had 7+ register functions...)obrien2002-02-011-3/+3
| | | | * Fix SCM ID's.
* Remove _THREAD_SAFE and make libc thread-safe by default bydeischen2001-01-241-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | adding (weak definitions to) stubs for some of the pthread functions. If the threads library is linked in, the real pthread functions will pulled in. Use the following convention for system calls wrapped by the threads library: __sys_foo - actual system call _foo - weak definition to __sys_foo foo - weak definition to __sys_foo Change all libc uses of system calls wrapped by the threads library from foo to _foo. In order to define the prototypes for _foo(), we introduce namespace.h and un-namespace.h (suggested by bde). All files that need to reference these system calls, should include namespace.h before any standard includes, then include un-namespace.h after the standard includes and before any local includes. <db.h> is an exception and shouldn't be included in between namespace.h and un-namespace.h namespace.h will define foo to _foo, and un-namespace.h will undefine foo. Try to eliminate some of the recursive calls to MT-safe functions in libc/stdio in preparation for adding a mutex to FILE. We have recursive mutexes, but would like to avoid using them if possible. Remove uneeded includes of <errno.h> from a few files. Add $FreeBSD$ to a few files in order to pass commitprep. Approved by: -arch
* Simplify sytem call renaming. Instead of _foo() <-- _libc_foo <-- foo(),jasone2000-01-271-12/+12
| | | | | | | | | | | | | | | | | just use _foo() <-- foo(). In the case of a libpthread that doesn't do call conversion (such as linuxthreads and our upcoming libpthread), this is adequate. In the case of libc_r, we still need three names, which are now _thread_sys_foo() <-- _foo() <-- foo(). Convert all internal libc usage of: aio_suspend(), close(), fsync(), msync(), nanosleep(), open(), fcntl(), read(), and write() to _foo() instead of foo(). Remove all internal libc usage of: creat(), pause(), sleep(), system(), tcdrain(), wait(), and waitpid(). Make thread cancellation fully POSIX-compliant. Suggested by: deischen
* Add three-tier symbol naming in support of POSIX thread cancellationjasone2000-01-121-12/+14
| | | | | | points. For library functions, the pattern is __sleep() <-- _libc_sleep() <-- sleep(). The arrows represent weak aliases. For system calls, the pattern is _read() <-- _libc_read() <-- read().
* Conform to POSIX and close any copies of popen() descriptors inherited by amsmith1998-10-151-0/+4
| | | | | | | popen()ed child. PR: misc/7810 Submitted by: Wayne Scott <wscott@ichips.intel.com>
* Avoid the need for calling functions that malloc after a vfork().peter1998-10-111-2/+10
|
* vfork -> fork. The child calls execl() which calls malloc(), sobde1998-10-101-1/+1
| | | | | | | | | vfork() can't be used. We could use alloca() in execl() so that it can be called between vfork() and execve(), but a "portable" popen() shouldn't depend on this. Calling execle() instead of execl() should be fairly safe, since execle() is supposed to be callable from signal handlers and signal handlers can't call malloc(). However, execle() is broken.
* FIxed the cleanup. I forgot to leave stdin alone in the usual (!twoway)bde1997-04-221-1/+2
| | | | case.
* Clean-up my modification of popen.c for vfork. Bruce's (this) is better.dyson1997-04-201-10/+12
| | | | Submitted by: Bruce Evans <bde@freebsd.org>
* Fix the problem in popen that makes correct vfork semantics fail.dyson1997-04-161-6/+11
| | | | | | Specifically, popen modifies a variable "pdes[1]" in the child in such a way that it breaks code in the parent (due to the address space sharing.)
* Fixed cleaning up after malloc failure, which was broken by Lite2.bde1997-03-111-3/+5
| | | | | | We don't use socketpair(), so don't #include <sys/socket.h>. Restored some gcc-quieting parentheses that were lost in the Lite2 merge.
* Merge from Lite2:peter1997-03-111-21/+28
| | | | | filesystem include updates, duplicate group suppression, cleanups, filesystem whiteout support (unionfs), bidir popen().
* General -Wall warning cleanup, part I.jkh1996-07-121-1/+1
| | | | Submitted-By: Kent Vander Velden <graphix@iastate.edu>
* Don't cast void functions to void.hsu1995-06-201-2/+2
| | | | Obtained from: NetBSD commit by jtc on June 16, 1995.
* Remove trailing whitespace.rgrimes1995-05-301-3/+3
|
* BSD 4.4 Lite Lib Sourcesrgrimes1994-05-271-0/+160
OpenPOWER on IntegriCloud