Читаем UNIX: взаимодействие процессов полностью

23  #endif


24  #ifdef HAVE_SEMAPHORE_H

25  #include /* семафоры Posix */

26  #ifndef SEM_FAILED

27  #define SEM_FAILED ((sem_t *)(-1))

28  #endif

29  #endif


30  #ifdef HAVE_SYS_MMAN_H

31  #include /* разделяемая память Posix */

32  #endif


33  #ifndef MAP_FAILED

34  #define MAP_FAILED ((void *)(-1))

35  #endif


36  #ifdef HAVE_SYS_IPC_H

37  #include /* System V IPC */

38  #endif


39  #ifdef HAVE_SYS_MSG_H

40  #include /* очереди сообщений System V */

41  #endif


42  #ifdef HAVE_SYS_SEM_H

43  #ifdef __bsdi__

44  #undef HAVE_SYS_SEM_H /* тонкий момент: прототип semctl() в BSDI's содержит ошибки*/

45  #else

46  #include /* семафоры System V */

47  #endif

48  #ifndef HAVE_SEMUN_UNION /* $$.It semun$$ */

49  union semun { /* определение объединения для semctl() */

50   int val;

51   struct semid_ds *buf;

52   unsigned short *array;

53  };

54  #endif

55  #endif /* HAVE_SYS_SEM_H */


56  #ifdef HAVE_SYS_SHM_H

57  #include /* разделяемая память System V */

58  #endif


59  #ifdef HAVE_SYS_SELECT_H

60  #include /* для удобства */

61  #endif


62  #ifdef HAVE_POLL_H

63  #include /* для удобства */

64  #endif


65  #ifdef HAVE_STROPTS_H

66  #include /* для удобства */

67  #endif


68  #ifdef HAVE_STRINGS_H

69  #include /* для удобства */

70  #endif


71  /* Следующие три заголовочных файла нужны для ioctl файлов и сокетов:

72   * , , и .

73   */

74  #ifdef HAVE_SYS_IOCTL_H

75  #include

76  #endif

77  #ifdef HAVE_SYS_FILIO_H

78  #include

79  #endif


80  #ifdef HAVE_PTHREAD_H

81  #include

82  #endif

83  #ifdef HAVE_DOOR_H

84  #include /* интерфейс дверей Solaris */

85  #endif

86  #ifdef HAVE_RPC_RPC_H

87  #ifdef _PSX4_NSPACE_H_TS /* баги Digital Unix 4.0b */

88  #undef SUCCESS

89  #endif

90  #include /* Sun RPC */

91  #endif


92  /* Определяем bzero() как макрос, если его нет в стандартной библиотеке С */

93  #ifndef HAVE_BZERO

94  #define bzero(ptr,n) memset(ptr, 0, n)

95  #endif


96  /* Posix.1g требует, чтобы INFTIM определялось в . но во многих системах эта

97     константа все еще определяется в . Нам не нужно подключать все

98     функции для работы с потоками, поэтому мы определяем INFTM здесь. Это стандартное

99     значение, но нет гарантий, что оно равно –1 */

100 #ifndef INFTIM

101 #define INFTIM (-1) /* неограниченное время опроса */

102 #ifdef HAVE_POLL_H

103 #define INFTIM_UNPH /* чтобы из файла unpxti.h узнать, что константа определена */

104 #endif

105 #endif


106 /* Прочие константы */

107 #ifndef РАТН_МАХ /* должна быть в */

108 #define PATH_MAX 1024 /* максимальное количество символов в полном имени файла */

109 #endif

110 #define MAX_PATH 1024

Перейти на страницу:

Все книги серии Мастер-класс

Секреты резьбы по дереву
Секреты резьбы по дереву

Изделия из древесины и материалов, имитирующих ее текстуру, привычным образом окружают нас в повседневной жизни, поэтому мы относимся к ней как к чему-то обыденному. Но как только ее коснется умелая рука мастера резьбы по дереву, рождается произведение искусства и раскрываются такие качества древесины, как богатая фактура, разнообразие цветов, особая теплота. Эта книга поможет читателю открыть для себя удивительный мир творчества и познать секреты резьбы по дереву. Автор надеется, что начинающие резчики найдут в ней интересный и полезный материал, который позволит им стать мастерами. В приложении представлены рисунки орнаментов и различных узоров, которые на первых порах можно копировать, а по мере приобретения навыка на их основе разрабатывать свои образцы.

Галина Алексеевна Серикова

Сделай сам / Хобби и ремесла / Руководства / Дом и досуг / Словари и Энциклопедии

Похожие книги

C++ Primer Plus
C++ Primer Plus

C++ Primer Plus is a carefully crafted, complete tutorial on one of the most significant and widely used programming languages today. An accessible and easy-to-use self-study guide, this book is appropriate for both serious students of programming as well as developers already proficient in other languages.The sixth edition of C++ Primer Plus has been updated and expanded to cover the latest developments in C++, including a detailed look at the new C++11 standard.Author and educator Stephen Prata has created an introduction to C++ that is instructive, clear, and insightful. Fundamental programming concepts are explained along with details of the C++ language. Many short, practical examples illustrate just one or two concepts at a time, encouraging readers to master new topics by immediately putting them to use.Review questions and programming exercises at the end of each chapter help readers zero in on the most critical information and digest the most difficult concepts.In C++ Primer Plus, you'll find depth, breadth, and a variety of teaching techniques and tools to enhance your learning:• A new detailed chapter on the changes and additional capabilities introduced in the C++11 standard• Complete, integrated discussion of both basic C language and additional C++ features• Clear guidance about when and why to use a feature• Hands-on learning with concise and simple examples that develop your understanding a concept or two at a time• Hundreds of practical sample programs• Review questions and programming exercises at the end of each chapter to test your understanding• Coverage of generic C++ gives you the greatest possible flexibility• Teaches the ISO standard, including discussions of templates, the Standard Template Library, the string class, exceptions, RTTI, and namespaces

Стивен Прата

Программирование, программы, базы данных
Programming with POSIX® Threads
Programming with POSIX® Threads

With this practical book, you will attain a solid understanding of threads and will discover how to put this powerful mode of programming to work in real-world applications. The primary advantage of threaded programming is that it enables your applications to accomplish more than one task at the same time by using the number-crunching power of multiprocessor parallelism and by automatically exploiting I/O concurrency in your code, even on a single processor machine. The result: applications that are faster, more responsive to users, and often easier to maintain. Threaded programming is particularly well suited to network programming where it helps alleviate the bottleneck of slow network I/O. This book offers an in-depth description of the IEEE operating system interface standard, POSIX (Portable Operating System Interface) threads, commonly called Pthreads. Written for experienced C programmers, but assuming no previous knowledge of threads, the book explains basic concepts such as asynchronous programming, the lifecycle of a thread, and synchronization. You then move to more advanced topics such as attributes objects, thread-specific data, and realtime scheduling. An entire chapter is devoted to "real code," with a look at barriers, read/write locks, the work queue manager, and how to utilize existing libraries. In addition, the book tackles one of the thorniest problems faced by thread programmers-debugging-with valuable suggestions on how to avoid code errors and performance problems from the outset. Numerous annotated examples are used to illustrate real-world concepts. A Pthreads mini-reference and a look at future standardization are also included.

David Butenhof

Программирование, программы, базы данных
Adobe InDesign CS3
Adobe InDesign CS3

Книга посвящена верстке и макетированию в программе Adobe InDesign CS3. Помимо того что в ней описываются возможности программы, рассматриваются также принципы и традиции верстки, приводятся примеры решения типичных задач. Все это позволит читателю не только овладеть богатым инструментарием программы, но и грамотно применять его.Материал книги разделен на логические части: теоретические сведения, инструментарий программы, решение задач, – а также рассчитан на два уровня подготовки читателей – начинающих и опытных пользователей, что выгодно отличает книгу от других изданий. Это позволит применять ее как новичкам для знакомства с программой, так и пользователям со стажем для пополнения своих знаний.

Владимир Гавриилович Завгородний , Владимир Завгородний

Программирование, программы, базы данных / Программное обеспечение / Книги по IT
3ds Max 2008
3ds Max 2008

Одни уверены, что нет лучшего способа обучения 3ds Мах, чем прочитать хорошую книгу. Другие склоняются к тому, что эффективнее учиться у преподавателя, который показывает, что и как нужно делать. Данное издание объединяет оба подхода. Его цель – сделать освоение 3ds Мах 2008 максимально быстрым и результативным. Часто после изучения книги у читателя возникают вопросы, почему не получился тот или иной пример. Видеокурс – это гарантия, что такие вопросы не возникнут: ведь автор не только рассказывает, но и показывает, как нужно работать в 3ds Мах.В отличие от большинства интерактивных курсов, где работа в 3ds Мах иллюстрируется на кубиках-шариках, данный видеокурс полностью практический. Все приемы работы с инструментами 3ds Мах 2008 показаны на конкретных примерах, благодаря чему после просмотра курса читатель сможет самостоятельно выполнять даже сложные проекты.

Владимир Антонович Верстак , Владимир Верстак

Программирование, программы, базы данных / Программное обеспечение / Книги по IT