lkml.org 
[lkml]   [1999]   [Feb]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: vfork() from userland
Date
From

Your program is buggy. If execlp() fails, you must call _exit()
immediately; otherwise main will return twice and the stack will be
trashed.

I am not certain whether calling fprintf() or execlp() in the child is
safe. I would avoid everything but system calls - write(), execve(),
etc.

It is also possible that the default wrapper used by syscall() doesn't
work correctly with vfork. If this were the case, however, your first
program should have blown up too.

zw

-
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:50    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site