summaryrefslogtreecommitdiff
path: root/lib/libc/gen/popen.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove unused variable: omask.Tim J. Robbins2003-01-041-1/+0
| | | | Notes: svn path=/head/; revision=108630
* Protect pidlist with a mutex to avoid a race causing a duplicate free()Tim J. Robbins2003-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. Notes: svn path=/head/; revision=108580
* * Remove 'register'. (some functions had 7+ register functions...)David E. O'Brien2002-02-011-3/+3
| | | | | | | * Fix SCM ID's. Notes: svn path=/head/; revision=90041
* Remove _THREAD_SAFE and make libc thread-safe by default byDaniel Eischen2001-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 Notes: svn path=/head/; revision=71579
* Simplify sytem call renaming. Instead of _foo() <-- _libc_foo <-- foo(),Jason Evans2000-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 Notes: svn path=/head/; revision=56698
* Add three-tier symbol naming in support of POSIX thread cancellationJason Evans2000-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(). Notes: svn path=/head/; revision=55837
* Conform to POSIX and close any copies of popen() descriptors inherited by aMike Smith1998-10-151-0/+4
| | | | | | | | | | popen()ed child. PR: misc/7810 Submitted by: Wayne Scott <wscott@ichips.intel.com> Notes: svn path=/head/; revision=40367
* Avoid the need for calling functions that malloc after a vfork().Peter Wemm1998-10-111-2/+10
| | | | Notes: svn path=/head/; revision=40219
* vfork -> fork. The child calls execl() which calls malloc(), soBruce Evans1998-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. Notes: svn path=/head/; revision=40191
* FIxed the cleanup. I forgot to leave stdin alone in the usual (!twoway)Bruce Evans1997-04-221-1/+2
| | | | | | | case. Notes: svn path=/head/; revision=25084
* Clean-up my modification of popen.c for vfork. Bruce's (this) is better.John Dyson1997-04-201-10/+12
| | | | | | | Submitted by: Bruce Evans <bde@freebsd.org> Notes: svn path=/head/; revision=25063
* Fix the problem in popen that makes correct vfork semantics fail.John 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.) Notes: svn path=/head/; revision=24975
* Fixed cleaning up after malloc failure, which was broken by Lite2.Bruce Evans1997-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. Notes: svn path=/head/; revision=23734
* Merge from Lite2:Peter Wemm1997-03-111-21/+28
| | | | | | | | filesystem include updates, duplicate group suppression, cleanups, filesystem whiteout support (unionfs), bidir popen(). Notes: svn path=/head/; revision=23668
* General -Wall warning cleanup, part I.Jordan K. Hubbard1996-07-121-1/+1
| | | | | | | Submitted-By: Kent Vander Velden <graphix@iastate.edu> Notes: svn path=/head/; revision=17141
* Don't cast void functions to void.Jeffrey Hsu1995-06-201-2/+2
| | | | | | | Obtained from: NetBSD commit by jtc on June 16, 1995. Notes: svn path=/head/; revision=9272
* Remove trailing whitespace.Rodney W. Grimes1995-05-301-3/+3
| | | | Notes: svn path=/head/; revision=8870
* BSD 4.4 Lite Lib SourcesRodney W. Grimes1994-05-271-0/+160
Notes: svn path=/cvs2svn/branches/unlabeled-1.1.1/; revision=1573