This namespace defines an OS independent programming API that shields developers from nonportable aspects of writing efficient system programs on Win32, POSIX and other versions of UNIX, and various real-time operating systems.
This class is a wrapper for the XTI/TLI operations.
This namespace encapsulates the differences between various OS platforms. When porting ACE to a new platform, this class is the place to focus on. Once this file is ported to a new platform, pretty much everything else comes for "free." See <www.cs.wustl.edu/~schmidt/ACE_wrappers/etc/ACE-porting.html> for instructions on porting ACE. Please see the README file in this directory for complete information on the meaning of the various macros.
说得很厉害一样,就是实现了跨平台功能,才用ACE_OS 这个命名空间来封装。
头文件 "ace/OS_NS_fcntl.h" 下的函数:
1 ACE_HANDLE open (const char *filename,
int mode,
mode_t perms = ACE_DEFAULT_OPEN_PERMS,
LPSECURITY_ATTRIBUTES sa = 0);//打开一个文件;
2 int fcntl (ACE_HANDLE handle,
int cmd,
long arg = 0);
头文件 "ace/OS_NS_stdio.h"下的函数:
1 int sprintf (char *buf, const char *format, ...);
2 int vasprintf (char **bufp, const char *format, va_list argptr);
头文件 “ace/OS_NS_stdlib.h” 下的函数://相当于c 语言中的 stdlib.h,包括内存的申请和释放
1 int atoi (const char *s);
2 long atol (const char *s);
3 void free (void *);
4 int setenv(const char *envname, const char *envval, int overwrite); 等函数。
头文件 “ace/OS_NS_pwd.h” 下的函数:
1 struct passwd *getpwnam (const char *user);
头文件 “ace/OS_NS_unistd.h” 下的函数:
1 int access (const char *path, int amode);
2 int argv_to_string (ACE_TCHAR **argv,
ACE_TCHAR *&buf,
bool substitute_env_args = true,
bool quote_args = false);
3 int rmdir (const char *path);
4 pid_t fork (void); 等函数
5 int sleep (u_int seconds);
头文件 "ace/OS_NS_string.h"下的函数://字符串操作
1 char *strcpy (char *s, const char *t);
2 int strcmp (const ACE_WCHAR_T *s, const ACE_WCHAR_T *t);
3 void *memset (void *s, int c, size_t len);
头文件 "ace/os_include/os_netdb.h" 包含 MAXHOSTNAMELEN 的定义。