The Open Group New API Set Proposals Austin-xxx Page 1 of 1 Submitted by Andrew Josey, The Open Group. February xx, 2006 The Open Group's Base Working Group is developing four new sets of APIs for consideration as input into the next revision of the Austin Group joint standard (IEEE Std POSIX 1003.1 and The Open Group Base Specifications). This document provides a brief overview of these APIs. These are currently out for review. For instructions on how to obtain the drafts and comment see http://www.opengroup.org/platform/doc-review/ . The purpose of these new Technical Standards is to define additional sets of New API Extensions to further increase application capture and hence portability for systems built upon version 3 of the Single UNIX Specification. Overview of the Extended API Set Part 1 The Extended API Set Part 1 is expected to consist of twenty-five new system interfaces, and one extension to the ls utility. It also introduces the concept of a stream associated with a memory buffer to eliminate may of the errors encountered in the construction of strings, notably overflowing of strings. The system interfaces are as follows (listed by header): alphasort() dirfd() scandir() psignal() psiginfo() dprintf() fmemopen() getdelim() getline() open_memstream() open_wmemstream() mkdtemp() stpcpy() stpncpy() strndup() strnlen() strsignal() mbsnrtowcs() wcpcpy() wcpncpy() wcscasecmp() wcsdup() wcsncasecmp() wcsnlen() wcsnrtombs() Overview of the Extended API Set Part 2 The Extended API Set Part 2 is expected to consist of sixteen new system interfaces. The set of interfaces includes: faccessat() fchmodat() fchownat() fdopendir() fexecve() fstatat() futimesat() linkat() mkdirat() mkfifoat() mknodat() openat() readlinkat() renameat() symlinkat() unlinkat() The motivation for the introduction of this set of interfaces is as follows: * Interfaces taking a path name are limited by the maximum length of a path name(_SC_PATH_MAX). The absolute path of files can far exceed this length. The current solution would be to change the working directory and use relative path names. This is not thread-safe. * A second motivation is that files accessed outside the current working directory are subject to attacks caused by the race condition created by change any of the elements ofthe path names used. * A third motivation is to allow implementing code which uses a virtual current working directory for each individual thread. In the current model there is only one current working directory for all threads. The new interfaces solve these issues by duplicating existing interfaces using path names with one change, that is an additional parameter. This additional parameter must be a file descriptor for a directory. The operations will then work relative to the specified directory instead of the current working directory whenever the later would be accessed. Overview of Extended API Set 3 This proposed set of changes introduces the concept of Robust mutexes which allow for recovery from some failure situations when programming with threads. This includes the addition of robust mutexes and two new interfaces: pthread_mutexattr_getrobust() pthread_mutexattr_setrobust() It also includes some additions to existing interfaces: pthread_cond_timedwait() pthread_cond_wait() pthread_mutex_init() pthread_mutex_lock() pthread_mutex_trylock() pthread_mutex_timedlock() Overview of Extended API Set 4 The locale model currently used in POSIX and the Single UNIX Specificatoin was designed at a time when threads were not used at all or at least were just appearing. Therefore the interface to the locale information was designed like many other interfaces with process-global access. This has become a problem now that threads are widely deployed. For other programming languages (C++, Java) the language designers thought about this problem in advance and standardized a locale model which can be used in multi-threaded applications. This set of changes proposes an extension to POSIX to enable the use of locales in multi-threaded applications and for implementations of the locale models in C++. The goal has been to require as little change in existing applications as possible to use the new features. New interfaces include: duplocale() freelocale() newlocale() uselocale() Thread-aware versions of existing interfaces include: isalnum_l() isalpha_l() isblank_l() iscntrl_l() isdigit_l() isgraph_l() islower_l() isprint_l() ispunct_l() isspace_l() isupper_l() iswalnum_l() iswalpha_l() iswblank_l() iswcntrl_l() iswctype_l() iswdigit_l() iswgraph_l() iswlower_l() iswprint_l() iswpunct_l() iswspace_l() iswupper_l() iswxdigit_l() isxdigit_l() nl_langinfo_l() strcasecmp_l() strcoll_l() strfmon_l() strftime_l() strxfrm_l() tolower_l() toupper_l() towctrans_l() towlower_l() towupper_l() wcscasecmp_l() wcscoll_l() wcsxfrm_l() wctrans_l() wctype_l()