Skip to Content
Advanced Programming in the UNIX® Environment: Second Edition
book

Advanced Programming in the UNIX® Environment: Second Edition

by W. Richard Stevens, Stephen A. Rago
June 2005
Intermediate to advanced
960 pages
23h 41m
English
Addison-Wesley Professional
Content preview from Advanced Programming in the UNIX® Environment: Second Edition

Appendix B. Miscellaneous Source Code

Our Header File

Most programs in the text include the header apue.h, shown in Figure B.1. It defines constants (such as MAXLINE) and prototypes for our own functions.

Example B.1. Our header: apue.h

 /* Our own header, to be included before all standard system headers */ #ifndef _APUE_H #define _APUE_H #define _XOPEN_SOURCE 600 /* Single UNIX Specification, Version 3 */ #include <sys/types.h> /* some systems still require this */ #include <sys/stat.h> #include <sys/termios.h> /* for winsize */ #ifndef TIOCGWINSZ #include <sys/ioctl.h> #endif #include <stdio.h> /* for convenience */ #include <stdlib.h> /* for convenience */ #include <stddef.h> /* for offsetof */ #include <string.h> /* for convenience */ #include ...
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

Advanced Programming in the UNIX® Environment, Third Edition

Advanced Programming in the UNIX® Environment, Third Edition

W. Richard Stevens, Stephen A. Rago
What Employees Want Most in Uncertain Times

What Employees Want Most in Uncertain Times

Kristine W. Powers, Jessica B.B. Diaz

Publisher Resources

ISBN: 0201433079Purchase book