1 <!-- Copyright (C) 2003 Red Hat, Inc. -->
2 <!-- This material may be distributed only subject to the terms -->
3 <!-- and conditions set forth in the Open Publication License, v1.0 -->
4 <!-- or later (the latest version is presently available at -->
5 <!-- http://www.opencontent.org/openpub/). -->
6 <!-- Distribution of the work or derivative of the work in any -->
7 <!-- standard (paper) book form is prohibited unless prior -->
8 <!-- permission is obtained from the copyright holder. -->
12 >POSIX Standard Support</TITLE
13 ><meta name="MSSmartTagsPreventParsing" content="TRUE">
16 CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
19 TITLE="eCos Reference Manual"
20 HREF="ecos-ref.html"><LINK
22 TITLE="eCos POSIX compatibility layer"
23 HREF="posix-compatibility.html"><LINK
25 TITLE="eCos POSIX compatibility layer"
26 HREF="posix-compatibility.html"><LINK
28 TITLE="Process Environment [POSIX Section 4]"
29 HREF="posix-process-environment.html"></HEAD
40 SUMMARY="Header navigation table"
49 >eCos Reference Manual</TH
57 HREF="posix-compatibility.html"
71 HREF="posix-process-environment.html"
84 NAME="POSIX-STANDARD-SUPPORT">Chapter 31. POSIX Standard Support</H1
94 HREF="posix-standard-support.html#POSIX-PROCESS-PRIMITIVES"
95 >Process Primitives [POSIX Section 3]</A
99 HREF="posix-process-environment.html"
100 >Process Environment [POSIX Section 4]</A
104 HREF="posix-files-and-directories.html"
105 >Files and Directories [POSIX Section 5]</A
109 HREF="posix-input-and-output.html"
110 >Input and Output [POSIX Section 6]</A
114 HREF="posix-device-and-class-specific-functions.html"
115 >Device and Class Specific Functions [POSIX Section 7]</A
119 HREF="posix-c-language-services.html"
120 >C Language Services [POSIX Section 8]</A
124 HREF="posix-system-databases.html"
125 >System Databases [POSIX Section 9]</A
129 HREF="posix-data-interchange-format.html"
130 >Data Interchange Format [POSIX Section 10]</A
134 HREF="posix-synchronization.html"
135 >Synchronization [POSIX Section 11]</A
139 HREF="posix-memory-management.html"
140 >Memory Management [POSIX Section 12]</A
144 HREF="posix-execution-scheduling.html"
145 >Execution Scheduling [POSIX Section 13]</A
149 HREF="posix-clocks-and-timers.html"
150 >Clocks and Timers [POSIX Section 14]</A
154 HREF="posix-message-passing.html"
155 >Message Passing [POSIX Section 15]</A
159 HREF="posix-thread-management.html"
160 >Thread Management [POSIX Section 16]</A
164 HREF="posix-thread-specific-data.html"
165 >Thread-Specific Data [POSIX Section 17]</A
169 HREF="posix-thread-cancellation.html"
170 >Thread Cancellation [POSIX Section 18]</A
174 HREF="posix-non-posix-functions.html"
175 >Non-POSIX Functions</A
180 > eCos contains support for the POSIX Specification (ISO/IEC
181 9945-1)[POSIX].
184 > POSIX support is divided between the POSIX and the FILEIO
185 packages. The POSIX package provides support for threads,
186 signals, synchronization, timers and message queues. The FILEIO
187 package provides support for file and device I/O. The two
188 packages may be used together or separately, depending on
192 > This document takes a functional approach to the POSIX
193 library. Support for a function implies that the data types and
194 definitions necessary to support that function, and the objects
195 it manipulates, are also defined. Any exceptions to this are
196 noted, and unless otherwise noted, implemented functions behave
197 as specified in the POSIX standard.
200 > This document only covers the differences between the eCos
201 implementation and the standard; it does not provide complete
202 documentation. For full information, see the POSIX standard
203 [POSIX]. Online, the Open Group Single Unix
204 Specification [SUS2] provides complete documentation
205 of a superset of POSIX. If you have access to a Unix system with
206 POSIX compatibility, then the manual pages for this will be of
207 use. There are also a number of books available.
208 [Lewine] covers the process, signal, file and I/O
209 functions, while [Lewis1], [Lewis2],
210 [Nichols] and [Norton] cover Pthreads and
211 related topics (see Bibliography, xref). However, many of these
212 books are oriented toward using POSIX in non-embedded systems,
213 so care should be taken in applying them to programming under
217 > The remainder of this chapter broadly follows the structure
218 of the POSIX Specification. References to the appropriate
219 section of the Standard are included.
222 > Omitted functions marked with “// TBA”
223 are potential candidates for later implementation.
230 NAME="POSIX-PROCESS-PRIMITIVES">Process Primitives [POSIX Section 3]</H1
236 NAME="AEN12979">Functions Implemented</H2
245 >int kill(pid_t pid, int sig);
246 int pthread_kill(pthread_t thread, int sig);
247 int sigaction(int sig, const struct sigaction *act,
248 struct sigaction *oact);
249 int sigqueue(pid_t pid, int sig, const union sigval value);
250 int sigprocmask(int how, const sigset_t *set,
251 sigset_t *oset);
252 int pthread_sigmask(int how, const sigset_t *set,
253 sigset_t *oset);
254 int sigpending(sigset_t *set);
255 int sigsuspend(const sigset_t *set);
256 int sigwait(const sigset_t *set, int *sig);
257 int sigwaitinfo(const sigset_t *set, siginfo_t *info);
258 int sigtimedwait(const sigset_t *set, siginfo_t *info,
259 const struct timespec *timeout);
260 int sigemptyset(sigset_t *set);
261 int sigfillset(sigset_t *set);
262 int sigaddset(sigset_t *set, int signo);
263 int sigdelset(sigset_t *set, int signo);
264 int sigismember(const sigset_t *set, int signo);
265 unsigned int alarm( unsigned int seconds );
267 unsigned int sleep( unsigned int seconds );</PRE
277 NAME="AEN12982">Functions Omitted</H2
286 >pid_t fork(void);
287 int execl( const char *path, const char *arg, ... );
288 int execv( const char *path, char *const argv[] );
289 int execle( const char *path, const char *arg, ... );
290 int execve( const char *path, char *const argv[],
291 char *const envp[] );
292 int execlp( const char *path, const char *arg, ... );
293 int execvp( const char *path, char *const argv[] );
294 int pthread_atfork( void(*prepare)(void),
295 void (*parent)(void),
296 void (*child)() );
297 pid_t wait( int *stat_loc );
298 pid_t waitpid( pid_t pid, int *stat_loc,
300 void _exit( int status );</PRE
310 NAME="AEN12985">Notes</H2
316 > Signal handling may be enabled or disabled with the
317 CYGPKG_POSIX_SIGNALS option. Since signals are used
318 by other POSIX components, such as timers, disabling signals will
319 disable those components too.
345 which maps to the current process.
354 >SIGEV_THREAD</I
356 > notification type is
357 not currently implemented.
362 > Job Control and Memory Protection signals are
368 > An extra implementation defined
383 distinguish hardware generated exceptions from
389 > Extra signals are defined:
390 _SIGTRAP_,_SIGIOT_,
391 _SIGEMT_, and _SIGSYS_. These are
392 largely to maintain compatibility with the signal numbers used by
398 > Signal delivery may currently occur at unexpected places in some
399 API functions. Using <SPAN
406 control out of a signal handler may result in the interrupted
407 function not being able to complete properly. This may result in
408 later function calls failing or deadlocking.
420 SUMMARY="Footer navigation table"
431 HREF="posix-compatibility.html"
449 HREF="posix-process-environment.html"
459 >eCos POSIX compatibility layer</TD
465 HREF="posix-compatibility.html"
473 >Process Environment [POSIX Section 4]</TD