c - Invalid Argument error when using clone() -


i'm using function call clone()

clone (fun, (char*)stack + 0x500000, sigchld | clone_files | clone_fs, arg);

where fun function: int fun(void*), stack = malloc (0x500000), , arg of type void*.

i'm wondering other possible causes invalid argument perror.

i have checked stack not null.

man clone:

   child_stack  argument  specifies location of stack used    child process.  since child , calling process may share  mem‐    ory,    not possible child process execute in same    stack calling process.  calling process must  therefore  set    memory space child stack , pass pointer space    clone().  stacks grow downward on processors run linux (except     hp  pa  processors),  child_stack points topmost    address of memory space set child stack. 

Comments

Popular posts from this blog

Load Balancing in Bluemix using custom domain and DNS SRV records -

oracle - pls-00402 alias required in select list of cursor to avoid duplicate column names -

python - Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] error -