📄 posix-process-environment.html
字号:
<!-- Copyright (C) 2003 Red Hat, Inc. --><!-- This material may be distributed only subject to the terms --><!-- and conditions set forth in the Open Publication License, v1.0 --><!-- or later (the latest version is presently available at --><!-- http://www.opencontent.org/openpub/). --><!-- Distribution of the work or derivative of the work in any --><!-- standard (paper) book form is prohibited unless prior --><!-- permission is obtained from the copyright holder. --><HTML><HEAD><TITLE>Process Environment [POSIX Section 4]</TITLE><meta name="MSSmartTagsPreventParsing" content="TRUE"><METANAME="GENERATOR"CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+"><LINKREL="HOME"TITLE="eCos Reference Manual"HREF="ecos-ref.html"><LINKREL="UP"TITLE="POSIX Standard Support"HREF="posix-standard-support.html"><LINKREL="PREVIOUS"TITLE="POSIX Standard Support"HREF="posix-standard-support.html"><LINKREL="NEXT"TITLE="Files and Directories [POSIX Section 5]"HREF="posix-files-and-directories.html"></HEAD><BODYCLASS="SECT1"BGCOLOR="#FFFFFF"TEXT="#000000"LINK="#0000FF"VLINK="#840084"ALINK="#0000FF"><DIVCLASS="NAVHEADER"><TABLESUMMARY="Header navigation table"WIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><THCOLSPAN="3"ALIGN="center">eCos Reference Manual</TH></TR><TR><TDWIDTH="10%"ALIGN="left"VALIGN="bottom"><AHREF="posix-standard-support.html"ACCESSKEY="P">Prev</A></TD><TDWIDTH="80%"ALIGN="center"VALIGN="bottom">Chapter 31. POSIX Standard Support</TD><TDWIDTH="10%"ALIGN="right"VALIGN="bottom"><AHREF="posix-files-and-directories.html"ACCESSKEY="N">Next</A></TD></TR></TABLE><HRALIGN="LEFT"WIDTH="100%"></DIV><DIVCLASS="SECT1"><H1CLASS="SECT1"><ANAME="POSIX-PROCESS-ENVIRONMENT">Process Environment [POSIX Section 4]</H1><DIVCLASS="SECT2"><H2CLASS="SECT2"><ANAME="AEN13011">Functions Implemented</H2><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="SCREEN">int uname( struct utsname *name ); time_t time( time_t *tloc ); char *getenv( const char *name ); int isatty( int fd );long sysconf( int name );</PRE></TD></TR></TABLE></DIV><DIVCLASS="SECT2"><H2CLASS="SECT2"><ANAME="AEN13014">Functions Omitted</H2><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="SCREEN">pid_t getpid( void ); pid_t getppid( void ); uid_t getuid( void ); uid_t geteuid( void ); gid_t getgid( void ); gid_t getegid( void ); int setuid( uid_t uid ); int setgid( gid_t gid ); int getgroups( int gidsetsize, gid_t grouplist[] ); char *getlogin( void ); int getlogin_r( char *name, size_t namesize ); pid_t getpgrp( void ); pid_t setsid( void );int setpgid( pid_t pid, pid_t pgid ); char *ctermid( char *s); char *ttyname( int fd ); // TBA int ttyname_r( int fd, char *name, size_t namesize); // TBA clock_t times( struct tms *buffer ); // TBA</PRE></TD></TR></TABLE></DIV><DIVCLASS="SECT2"><H2CLASS="SECT2"><ANAME="AEN13017">Notes</H2><P></P><UL><LI><P>The fields of the <SPANCLASS="emphasis"><ICLASS="EMPHASIS">utsname</I></SPAN> structure are initialized as follows: <TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="SCREEN"> sysname “eCos” nodename “” (gethostname() is currently not available) release Major version number of the kernel version Minor version number of the kernel machine “” (Requires some config tool changes) </PRE></TD></TR></TABLE> </P><P> The sizes of these strings are defined by CYG_POSIX_UTSNAME_LENGTH and CYG_POSIX_UTSNAME_NODENAME_LENGTH. The latter defaults to the value of the former, but may also be set independently to accommodate a longer node name. </P></LI><LI><P> The <SPANCLASS="emphasis"><ICLASS="EMPHASIS">time()</I></SPAN> function is currently implemented in the C library. </P></LI><LI><P>A set of environment strings may be defined at configuration time with the CYGDAT_LIBC_DEFAULT_ENVIRONMENT option. The application may also define an environment by direct assignment to the <SPANCLASS="strong"><BCLASS="EMPHASIS">environ</B></SPAN> variable. </P></LI><LI><P> At present <SPANCLASS="emphasis"><ICLASS="EMPHASIS">isatty()</I></SPAN> assumes that any character device is a tty and that all other devices are not ttys. Since the only kind of device that eCos currently supports is serial character devices, this is an adequate distinction. </P></LI><LI><P> All system variables supported by sysconf will yield a value. However, those that are irrelevant to eCos will either return the default minimum defined in <TTCLASS="FILENAME"><limits.h></TT>, or zero. </P></LI></UL></DIV></DIV><DIVCLASS="NAVFOOTER"><HRALIGN="LEFT"WIDTH="100%"><TABLESUMMARY="Footer navigation table"WIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top"><AHREF="posix-standard-support.html"ACCESSKEY="P">Prev</A></TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="ecos-ref.html"ACCESSKEY="H">Home</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top"><AHREF="posix-files-and-directories.html"ACCESSKEY="N">Next</A></TD></TR><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top">POSIX Standard Support</TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="posix-standard-support.html"ACCESSKEY="U">Up</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top">Files and Directories [POSIX Section 5]</TD></TR></TABLE></DIV></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -