003 Linux System ProgrammingIssues, queries and suggestions related to Linux, Linux Programming, IPC, Interprocess Communication, Synchronization, Semaphore, System Programming, Linux Software Development.
RCS file: processes.c,v Working file: processes.c head: 1.21 branch: locks: strict root: 1.21 access list: symbolic names: keyword substitution: kv total revisions: 21; selected revisions: 21 description: This program series is used for learning prosess management ---------------------------- revision 1.21 locked by: root; date: 2015/12/22 09:31:53; author: root; state: Exp; lines: +1 -1 / Declared count. ---------------------------- revision 1.20 date: 2015/12/22 09:31:17; author: root; state: Exp; lines: +2 -1 Printing the no of bytes written to file. ---------------------------- revision 1.19 date: 2015/12/22 09:30:06; author: root; state: Exp; lines: +4 -1 Writing to the file. ---------------------------- revision 1.18 date: 2015/12/22 09:23:38; author: root; state: Exp; lines: +3 -1 We have a file descriptor and we want to pass this file descriptor to tnother process using execl(). As execl() takes only strings as argument but file descriptor is an integer. So we need to conver int ot string . this is done in our program using sprintf(). Now, the file descriptor is passed as argumne through execl(). ---------------------------- revision 1.17 date: 2015/12/22 09:21:08; author: root; state: Exp; lines: +2 -2 Reverting back to execl() after testing execv() ---------------------------- revision 1.16 date: 2015/12/22 09:18:59; author: root; state: Exp; lines: +1 -1 *** empty log message *** ---------------------------- revision 1.15 date: 2015/12/22 09:18:27; author: root; state: Exp; lines: +1 -1 *** empty log message *** ---------------------------- revision 1.14 date: 2015/12/22 09:17:18; author: root; state: Exp; lines: +1 -1 *** empty log message *** ---------------------------- revision 1.13 date: 2015/12/22 09:16:42; author: root; state: Exp; lines: +2 -6 *** empty log message *** ---------------------------- revision 1.12 date: 2015/12/22 09:15:18; author: root; state: Exp; lines: +3 -3 se ---------------------------- revision 1.11 date: 2015/12/22 09:14:40; author: root; state: Exp; lines: +4 -4 *** empty log message *** ---------------------------- revision 1.10 date: 2015/12/22 09:14:06; author: root; state: Exp; lines: +4 -4 se ---------------------------- revision 1.9 date: 2015/12/22 09:12:42; author: root; state: Exp; lines: +6 -1 replacing the execl() with execv(). i.e. instead of list of string arguments,,, Now, we pass a vector of arguments. ---------------------------- revision 1.8 date: 2015/12/22 09:03:15; author: root; state: Exp; lines: +3 -2 The parent process is now going to wait for the child process to finish its execution. We neeed to see that the parent process waits for child or new process or waits indefinitely. ---------------------------- revision 1.7 date: 2015/12/22 08:59:45; author: root; state: Exp; lines: +1 -0 Testing for.. when the parent process finiches and terminates. Before/After the child process. ---------------------------- revision 1.6 date: 2015/12/22 08:56:42; author: root; state: Exp; lines: +17 -5 Forkign a child process. Then ececl'ing a process from child process. This should not overwrite the parent process, but the child process will be killed. The new process will take over the PBC of child process and a new process context would be created for it. ---------------------------- revision 1.5 date: 2015/12/22 08:50:19; author: root; state: Exp; lines: +1 -1 Passing some string arguments to the replacing process. ---------------------------- revision 1.4 date: 2015/12/22 08:46:40; author: root; state: Exp; lines: +3 -0 Invoking the new process using process replacement , execl(). ---------------------------- revision 1.3 date: 2015/12/22 08:40:39; author: root; state: Exp; lines: +1 -1 *** empty log message *** ---------------------------- revision 1.2 date: 2015/12/22 08:39:47; author: root; state: Exp; lines: +13 -1 Opening the file whose name is collected through command line arguments. ---------------------------- revision 1.1 date: 2015/12/22 08:35:34; author: root; state: Exp; Initial revision =============================================================================
RCS file: reader.c,v Working file: reader.c head: 1.5 branch: locks: strict root: 1.5 access list: symbolic names: keyword substitution: kv total revisions: 5; selected revisions: 5 description: This peogram should be invoked through execl() ---------------------------- revision 1.5 locked by: root; date: 2015/12/22 09:36:20; author: root; state: Exp; lines: +1 -1 *** empty log message *** ---------------------------- revision 1.4 date: 2015/12/22 09:35:13; author: root; state: Exp; lines: +2 -1 Converting the file descriptor from string to integer as the file descriptor arrved through char *argv[] whils is a string ... to integer. ---------------------------- revision 1.3 date: 2015/12/22 09:34:04; author: root; state: Exp; lines: +4 -2 Reading from the file whose file descriptor was passed through command line. ---------------------------- revision 1.2 date: 2015/12/22 08:50:38; author: root; state: Exp; lines: +3 -0 Accepting and printing command line arguments. ---------------------------- revision 1.1 date: 2015/12/22 08:47:04; author: root; state: Exp; Initial revision =============================================================================