lkml.org 
[lkml]   [1999]   [Mar]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: popen/pclose problem in Linux 2.2.x with vfork/glibc 2.1
Date
From
In message <19990327180106.A22107@dancer.ca.sandia.gov>, Pete Wyckoff writes:
+-----
| pid = vfork();
| if (pid < 0) return -1;
| if (pid == 0) {
| if (dup2(p[1], 1) < 0)
| exit(127);
| close(p[0]);
| close(p[1]);
+--->8

Ahem. It's *vfork*, you can't do e.g. fd manipulations. (Does there exist a
"true vfork" where this would work? My memory of the original says "no,
forget it".)

(And shouldn't the exit()s in the child be _exit()s instead?)

--
brandon s. allbery [os/2][linux][solaris][japh] allbery@kf8nh.apk.net
system administrator [WAY too many hats] allbery@ece.cmu.edu
carnegie mellon / electrical and computer engineering KF8NH
We are Linux. Resistance is an indication that you missed the point.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:51    [W:0.058 / U:0.136 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site