Tag Info

New answers tagged

1

fork() is just a particular set of flags to the system call clone(). clone() is general enough to create either a "process" or a "thread" or even weird things that are somewhere between processes and threads (for example, different "processes" that share the same file descriptor table). Essentially, for every "type" of information associated with an ...


14

fork() was the original UNIX system call. It can only be used to create new processes, not threads. Also, it is portable. In Linux, clone() is a new, versatile system call which can be used to create a new thread of execution. Depending on the options passed, the new thread of execution can adhere to the semantics of a UNIX process, a POSIX thread, ...


4

It appears that there's two clone() things floating around in Linux 2.6 There's a system call: int clone(int (*fn)(void *), void *child_stack, int flags, void *arg, ... /* pid_t *ptid, struct user_desc *tls, pid_t *ctid */ ); This is the "clone()" described by doing man 2 clone. If you read that man page close enough, you will see ...


1

    file descriptor → file description → directory entry                dup                open                    cp There are several levels of indirection when going from an open file in a process all the way to the file content. Implementation-wise, these levels generally translate into data structures in the kernel pointing to the next level. I'm going ...


1

I'm interpreting the question as mainly about terminology, specifically the "file table". If you look at early implementations, the set of all open file descriptions in the system was an array. When a process needed a new open file description, the array was scanned for an unused slot and a pointer to that slot was returned. See for example falloc at the ...


0

I found the answer in documentation for the open system call: The term open file description is the one used by POSIX to refer to the entries in the system-wide table of open files. In other contexts, this object is variously also called an "open file object", a "file handle", an "open file table entry", or—in kernel-developer parlance—a struct file. ...


0

Trying to understand what your asking because it's not clear. But if I understand properly, your asking how can multiple processes write to the same file? Well in Linux, by default, files are not locked by processes and its always possible for multiple processes to write to the same file. Which of course risks breaking the files formatting. Writes tend to ...



Top 50 recent answers are included