Skip to Main Content
Linux Application Development, Second Edition
book

Linux Application Development, Second Edition

by Michael K. Johnson, Erik W. Troan
November 2004
Intermediate to advanced content levelIntermediate to advanced
736 pages
14h 4m
English
Addison-Wesley Professional
Content preview from Linux Application Development, Second Edition

Appendix B. ladsh Source Code

 1: /* ladsh4.c */ 2: 3: #define _GNU_SOURCE 4: 5: #include <ctype.h> 6: #include <errno.h> 7: #include <fcntl.h> 8: #include <glob.h> 9: #include <signal.h> 10: #include <stdio.h> 11: #include <stdlib.h> 12: #include <string.h> 13: #include <sys/ioctl.h> 14: #include <sys/wait.h> 15: #include <unistd.h> 16: 17: #define MAX_COMMAND_LEN 250 /* max length of a single command 18: string */ 19: #define JOB_STATUS_FORMAT "[%d] %-22s %.40s\n" 20: 21: struct jobSet { 22: struct job * head; /* head of list of running jobs */ 23: struct job * fg; /* current foreground job */ 24: }; 25: 26: enum redirectionType { REDIRECT_INPUT, REDIRECT_OVERWRITE, 27: REDIRECT_APPEND }; 28: 29: struct redirectionSpecifier { 30: enum redirectionType ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Linux System Programming, 2nd Edition

Linux System Programming, 2nd Edition

Robert Love

Publisher Resources

ISBN: 0321219147Purchase book