📄 posix.sgml
字号:
currently be ignored.
</para>
</listitem>
<listitem>
<para>
Most of the functionality of these functions depends on
the underlying filesystem.
</para>
</listitem>
<listitem>
<para>
Currently<emphasis> access()</emphasis> only checks the
<emphasis>F_OK</emphasis> mode explicitly, the others are
all assumed to be true by default.
</para>
</listitem>
<listitem>
<para>
The maximum number of open files allowed is supplied by
the CYGNUM_FILEIO_NFILE option. The maximum number
of file descriptors is supplied by the CYGNUM_FILEIO_NFD
option.
</para>
</listitem>
</itemizedlist>
</sect2>
</sect1>
<!-- }}} -->
<!-- {{{ Input and Output -->
<sect1 id="posix-input-and-output">
<title>Input and Output [POSIX Section 6]</title>
<!-- =================================================================== -->
<sect2>
<title>Functions Implemented</title>
<screen>
int dup( int fd );
int dup2( int fd, int fd2 );
int close(int fd);
ssize_t read(int fd, void *buf, size_t nbyte);
ssize_t write(int fd, const void *buf, size_t nbyte);
int fcntl( int fd, int cmd, ... );
off_t lseek(int fd, off_t offset, int whence);
int fsync( int fd );
int fdatasync( int fd );</screen>
</sect2>
<!-- =================================================================== -->
<sect2>
<title>Functions Omitted</title>
<screen>
int pipe( int fildes[2] );
int aio_read( struct aiocb *aiocbp ); // TBA
int aio_write( struct aiocb *aiocbp ); // TBA
int lio_listio( int mode, struct aiocb *const list[],
int nent, struct sigevent *sig); // TBA
int aio_error( struct aiocb *aiocbp ); // TBA
int aio_return( struct aiocb *aiocbp ); // TBA
int aio_cancel( int fd, struct aiocb *aiocbp ); // TBA
int aio_suspend( const struct aiocb *const list[],
int nent, const struct timespec *timeout ); // TBA
int aio_fsync( int op, struct aiocb *aiocbp );
// TBA
</screen>
</sect2>
<!-- =================================================================== -->
<sect2>
<title>Notes</title>
<itemizedlist>
<listitem>
<para>
Only the <emphasis>F_DUPFD</emphasis> command
of <emphasis>fcntl()</emphasis> is currently implemented.
</para>
</listitem>
<listitem>
<para>
Most of the functionality of these functions depends on
the underlying filesystem.
</para>
</listitem>
</itemizedlist>
</sect2>
</sect1>
<!-- }}} -->
<!-- {{{ Device and Class Specific Functions -->
<sect1 id="posix-device-and-class-specific-functions">
<title>Device and Class Specific Functions [POSIX Section 7]</title>
<!-- =================================================================== -->
<sect2>
<title>Functions Implemented</title>
<screen>
speed_t cfgetospeed( const struct termios *termios_p );
int cfsetospeed( struct termios *termios_p, speed_t speed );
speed_t cfgetispeed( const struct termios *termios_p );
int cfsetispeed( struct termios *termios_p, speed_t speed );
int tcgetattr( int fd, struct termios *termios_p );
int tcsetattr( int fd, int optional_actions,
const struct termios *termios_p );
int tcsendbreak( int fd, int duration );
int tcdrain( int fd );
int tcflush( int fd, int queue_selector );
int tcsendbreak( int fd, int action );
</screen>
</sect2>
<!-- =================================================================== -->
<sect2>
<title>Functions Omitted</title>
<screen>
pid_t tcgetpgrp( int fd );
int tcsetpgrp( int fd, pid_t pgrp );</screen>
</sect2>
<!-- =================================================================== -->
<sect2>
<title>Notes</title>
<itemizedlist>
<listitem>
<para>
Only the functionality relevant to basic serial device
control is implemented. Only very limited support for
canonical input is provided, and then only via the
“tty” devices, not the “serial”
devices. None of the functionality relevant to job
control, controlling terminals and sessions is
implemented.
</para>
</listitem>
<listitem>
<para>
Only <emphasis>MIN</emphasis> = 0 and
<emphasis>TIME</emphasis> = 0 functionality is
provided.
</para>
</listitem>
<listitem>
<para>
Hardware flow control is supported if the underlying
device driver and serial port support it.
</para>
</listitem>
<listitem>
<para>
Support for break, framing and parity errors depends on
the functionality of the hardware and device driver.
</para>
</listitem>
</itemizedlist>
</sect2>
</sect1>
<!-- }}} -->
<!-- {{{ C Language Services -->
<sect1 id="posix-C-language-services">
<title>C Language Services [POSIX Section 8]</title>
<!-- =================================================================== -->
<sect2>
<title>Functions Implemented</title>
<screen>
char *setlocale( int category, const char *locale );
int fileno( FILE *stream );
FILE *fdopen( int fd, const char *type );
int getc_unlocked( FILE *stream);
int getchar_unlocked( void );
int putc_unlocked( FILE *stream );
int putchar_unlocked( void );
char *strtok_r( char *s, const char *sep,
char **lasts );
char *asctime_r( const struct tm *tm, char *buf );
char *ctime_r( const time_t *clock, char *buf );
struct tm *gmtime_r( const time_t *clock,
struct tm *result );
struct tm *localtime_r( const time_t *clock,
struct tm *result );
int rand_r( unsigned int *seed );
</screen>
</sect2>
<!-- =================================================================== -->
<sect2>
<title>Functions Omitted</title>
<screen>
void flockfile( FILE *file );
int ftrylockfile( FILE *file );
void funlockfile( FILE *file );
int sigsetjmp( sigjmp_buf env, int savemask ); // TBA
void siglongjmp( sigjmp_buf env, int val ); // TBA
void tzset(void); // TBA
</screen>
</sect2>
<!-- =================================================================== -->
<sect2>
<title>Notes</title>
<itemizedlist>
<listitem>
<para>
<emphasis>setlocale()</emphasis> is implemented in the C
library Internationalization package.
</para>
</listitem>
<listitem>
<para>
Functions <emphasis>fileno()</emphasis> and
<emphasis>fdopen()</emphasis> are implemented in the C
library STDIO package.
</para>
</listitem>
<listitem>
<para>
Functions <emphasis>getc_unlocked()</emphasis>,
<emphasis>getchar_unlocked()</emphasis>,
<emphasis>putc_unlocked()</emphasis> and
<emphasis>putchar_unlocked()</emphasis> are defined
but are currently identical to their non-unlocked
equivalents.
</para>
</listitem>
<listitem>
<para>
<emphasis>strtok_r()</emphasis>, <emphasis>asctime_r()</emphasis>,
<emphasis>ctime_r()</emphasis>, <emphasis>gmtime_r()</emphasis>,
<emphasis>localtime_r()</emphasis> and
<emphasis>rand_r()</emphasis> are all currently in
the C library, alongside their non-reentrant versions.
</para>
</listitem>
</itemizedlist>
</sect2>
</sect1>
<!-- }}} -->
<!-- {{{ System Databases -->
<sect1 id="posix-system-databases">
<title>System Databases [POSIX Section 9]</title>
<!-- =================================================================== -->
<sect2>
<title>Functions Implemented</title>
<para>
<none>
</para>
</sect2>
<!-- =================================================================== -->
<sect2>
<title>Functions Omitted</title>
<screen>
struct group *getgrgid( gid_t gid );
int getgrgid( gid_t gid, struct group *grp, char *buffer,
size_t bufsize, struct group **result );
struct group *getgrname( const char *name );
int getgrname_r( const char *name, struct group *grp,
char *buffer, size_t bufsize, struct group **result );
struct passwd *getpwuid( uid_t uid );
int getpwuid_r( uid_t uid, struct passwd *pwd,
char *buffer, size_t bufsize, struct passwd **result );
struct passwd *getpwnam( const char *name );
int getpwnam_r( const char *name, struct passwd *pwd,
char *buffer, size_t bufsize, struct passwd **result );
</screen>
</sect2>
<!-- =================================================================== -->
<sect2>
<title>Notes</title>
<itemizedlist>
<listitem>
<para>
None of the functions in this section are implemented.
</para>
</listitem>
</itemizedlist>
</sect2>
</sect1>
<!-- }}} -->
<!-- {{{ Data Interchange Format -->
<sect1 id="posix-data-interchange-format">
<title>Data Interchange Format [POSIX Section 10]</title>
<para>
This section details <emphasis>tar</emphasis> and
<emphasis>cpio</emphasis> formats. Neither of these is supported by
eCos.
</para>
</sect1>
<!-- }}} -->
<!-- {{{ Synchronization -->
<sect1 id="posix-synchronization">
<title>Synchronization [POSIX Section 11]</title>
<!-- =================================================================== -->
<sect2>
<title>Functions Implemented</title>
<screen>
int sem_init(sem_t *sem, int pshared, unsigned int value);
int sem_destroy(sem_t *sem);
int sem_wait(sem_t *sem);
int sem_trywait(sem_t *sem);
int sem_post(sem_t *sem);
int sem_getvalue(sem_t *sem, int *sval);
int pthread_mutexattr_init( pthread_mutexattr_t *attr);
int pthread_mutexattr_destroy( pthread_mutexattr_t *attr);
int pthread_mutex_init(pthread_mutex_t *mutex,
const pthread_mutexattr_t *mutex_attr);
int pthread_mutex_destroy(pthread_mutex_t *mutex);
int pthread_mutex_lock(pthread_mutex_t *mutex);
int pthread_mutex_trylock(pthread_mutex_t *mutex);
int pthread_mutex_unlock(pthread_mutex_t *mutex);
int pthread_condattr_init(pthread_condattr_t *attr);
int pthread_condattr_destroy(pthread_condattr_t *attr);
int pthread_cond_init(pthread_cond_t *cond,
const pthread_condattr_t *attr);
int pthread_cond_destroy(pthread_cond_t *cond);
int pthread_cond_signal(pthread_cond_t *cond);
int pthread_cond_broadcast(pthread_cond_t *cond);
int pthread_cond_wait(pthread_cond_t *cond,
pthread_mutex_t *mutex);
int pthread_cond_timedwait(pthread_cond_t *cond,
pthread_mutex_t *mutex,
const struct timespec *abstime);
</screen>
</sect2>
<!-- =================================================================== -->
<sect2>
<title>Functions Omitted</title>
<screen>
sem_t *sem_open(const char *name, int oflag, ...); // TBA
int sem_close(sem_t *sem); // TBA
int sem_unlink(const char *name); // TBA
int pthread_mutexattr_getpshared( const pthread_mutexattr_t *attr,
int *pshared );
int pthread_mutexattr_setpshared( const pthread_mutexattr_t *attr,
int pshared );
int pthread_condattr_getpshared( const pthread_condattr_t *attr,
int *pshared);
int pthread_condattr_setpshared( const pthread_condattr_t *attr,
int pshared);</screen>
</sect2>
<!-- =================================================================== -->
<sect2>
<title>Notes</title>
<itemizedlist>
<listitem>
<para>
The presence of semaphores is controlled by the
CYGPKG_POSIX_SEMAPHORES option. This in turn
causes the _POSIX_SEMAPHORES feature test
macro to be defined and the semaphore API to be made
available.
</para>
</listitem>
<listitem>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -