You are on page 1of 6

3/24/13

POSIX.1, POSIX.1b and POSIX.1c Function Calls


RTOS,securevirtualizationtechnologyforrealtimesystems,DO178Bandhypervisorforthemostdemandingembeddedoperatingsystemapplications...
SEAR C H

GO CONTACT US

FOLLOW US ON TWITTER

RTOS & TOOLS

I NDUSTRIES

RTOS TRAINING & S UPPORT

BOARD S UPPORT

CORPORATE

PARTNERS

HOME

POSIX.1,POSIX.1bandPOSIX.1cFunctionCalls
A real- tim e em bedded dev elopm en t referen ce gu ide
PROCESSES AND VIRTUAL MEMORY

A LynuxWorks embedded OS is featured in this embedded system application:

his is the co m ple te listing o f f unctio n ca lls f o r


POSIX.1 , POSIX.1 b an d POSIX.1 c. All of t h em are fu lly su pport ed by L yn xOS.

POSIX.1 function calls


Function a c c e s s a l a r m a s c t i m e c f g e t i s p e e d c f g e t o s p e e d c f s e t i s p e e d c f s e t o s p e e d c h d i r c h m o d c h o w n c l o s e c l o s e d i r c r e a t c t e r m i d c u s e r i d d u p d u p 2 e x e c l e x e c l e e x e c l p e x e c v e x e c v e e x e c v p _ e x i t f c n t l f d o p e n f o r k f p a t h c o n f f s t a t g e t c w d g e t e g i d g e t e n v g e t e u i d g e t g i d g e t g r g i d g e t g r n a m g e t g r o u p s g e t l o g i n g e t p g r p g e t p i d g e t p p i d g e t p w n a m POSIX Description Tests for file accessibility Schedules an alarm Converts a time structure to a string Reads terminal input baud rate Reads terminal output baud rate Sets terminal input baud rate Sets terminal output baud rate Changes current working directory Changes file mode Changes owner and/or group of a file Closes a file Ends directory read operation Creates a new file or rewrites an existing one Generates terminal pathname Gets user name Duplicates an open file descriptor Duplicates an open file descriptor Executes a file Executes a file Executes a file Executes a file Executes a file Executes a file Terminates a process Manipulates an open file descriptor Opens a stream on a file descriptor Creates a process Gets configuration variable for an open file Gets file status Gets current working directory Gets effective group ID Gets environment variable Gets effective user ID Gets real group ID Reads groups database based on group ID Reads groups database based on group name Gets supplementary group IDs Gets user name Gets process group ID Gets process ID Gets parent process ID Reads user database based on user name NASA's AVIRIS (Airborne Visible/Infrared Imaging Spectrometer)

Who else uses a LynuxWorks embedded operating system?

S ECURITY

WHITE PAPERS

Coming Together of Safety and (Cyber) Security Changes Demands in RTOS Market Separation kernels and secure hypervisors will be evermore in demand as safety and certification will be required in more and more applications. Governments are already working on infrastructures deploying this type of technology. (October 2012) Building in RTOS Support for Safety- & Security-Critical Systems LynuxWorks explains the differences between safetycritical and security-critical applications and how to meet their demanding requirements with the LynxOS-178 RTOS and the LynxSecure hypervisor. (EE Times Design, August 2011) Enhancing Application Performance on Multicore Systems Tips on optimizing a multicore real-time system, including virtualization, avoiding synchronization and concurrency while maximizing application parallelism. (Military Embedded Systems, February 2011) Hardware Virtualization puts a new spin on Secure Systems Real-time determinism and military security don't have to be separate realities. A combination of a secure separation kernel and an embedded hypervisor enables whole new levels of system security. (COTS Journal, October 2010) Using a Separation Kernel to add Military-Grade Security to Legacy Systems A challenge for the software designer is how to integrate modern military-grade software programs into legacy software designed long before security standards were

www.lnxw.net/products/posix/function-calls.php3

1/6

3/24/13
g e t p w u i d g e t u i d i s a t t y k i l l l i n k l o n g j m p l s e e k m k d i r m k f i f o o p e n o p e n d i r p a t h c o n f p a u s e p i p e r e a d r e a d d i r r e n a m e r e w i n d d i r r m d i r s e t g i d s e t j m p s e t l o c a l e s e t p g i d s e t u i d s i g a c t i o n s i g a d d s e t s i g d e l s e t s i g e m p t y s e t s i g f i l l s e t s i g i s m e m b e r s i g l o n g j m p s i g p e n d i n g s i g p r o c m a s k s i g s e t j m p s i g s u s p e n d s l e e p s t a t s y s c o n f t c d r a i n t c f l o w t c f l u s h t c g e t a t t r t c g e t p g r p t c s e n d b r e a k t c s e t a t t r t c s e t p g r p t i m e t i m e s t t y n a m e t z s e t u m a s k u n a m e u n l i n k u t i m e w a i t p i d w r i t e

POSIX.1, POSIX.1b and POSIX.1c Function Calls


Reads user database based on user ID Gets real user ID Determines if a file descriptor is associated with a terminal Sends a kill signal to a process Creates a link to a file Restores the calling environment Repositions read/write file offset Makes a directory Makes a FIFO special file Opens a file Opens a directory Gets configuration variables for a path Suspends a process execution Creates an interprocess channel Reads from a file Reads a directory Renames a file Resets the r e a d d i r ( )pointer Removes a directory Sets group ID Saves the calling environment for use by l o n g j m p ( ) Sets or queries a program's locale Sets a process group ID for job control Sets the user ID Examines and changes signal action Adds a signal to a signal set Removes a signal to a signal set Creates an empty signal set Creates a full set of signals Tests a signal for a selected member Goes to and restores signal mask Examines pending signals Examines and changes blocked signals Saves state for s i g l o n g j m p ( ) Waits for a signal Delays process execution Gets information about a file Gets system configuration information Waits for all output to be transmitted to the terminal Suspends/restarts terminal output Discards terminal data Gets terminal attributes Gets foreground process group ID Sends a break to a terminal Sets terminal attributes Sets foreground process group ID Determines the current calendar time Gets process times Determines a terminal pathname Sets the timezone from environment variables Sets the file creation mask Gets system name Removes a directory entry Sets file access and modification times Waits for process termination Writes to a file predominant in system requirements. (VME Critical Systems, Summer 2010) Virtualization: Keeping Embedded Software safe and Secure in an Unsafe World A new, secure methodology is needed to separate systems of different security levels which run on shared resources without compromising the performance of legacy systems. (EE Times, June 2010) Secure Virtualization Combines Traditional Desktop OSs and Embedded RTOSes in Military Embedded Systems Advances in software and hardware technologies now make it feasible to use both embedded and desktop operating systems in a secure military system. (Military Embedded Systems, May 2010) DO-178B Provides Certification Safety net Developers of commercial avionics software must demonstrate compliance with DO-178 guidelines. The FAA has issued additional guidance for so-called DO-178B Reusable Software Components (RSCs as defined in AC20-148), which allow for reuse of certifications. (COTS Journal, November 2009) Designing Safety-critical Avionics Software Using open Standards Safety-critical avionics systems have continually grown more complex and software-intensive. Regulatory authorities and avionics manufacturers have responded with guidance such as DO-178B and RSC to ensure that software performs safely, with controlled development cost. (Boards and Solutions, September 2009) Two Different Realms: RTOS Support for Safety-critical vs. Security-critical Systems Safety- and security-critical system functions are evolving simultaneously, with different yet similar requirements. Modern RTOSes are stepping up to meet these needs. (VME and Critical Systems, June 2009) Virtualization Makes Better use of Open-source OSes and apps With the introduction of the embedded hypervisor, embedded systems can avoid certain performance or licensing issues inherent to open-source OSes and applications. (EE Times, March 23, 2009) Secure Virtualization Technology can Extend the life of Legacy Systems By combining the concept of virtualization and security, one can consolidate multiple legacy systems running on heterogeneous operating systems onto a single host system with high-assurance security. (Military Embedded Systems, January/February 2009) Virtual Machines: Intel's CPU Extensions Transform Virtualization Virtualization has traditionally presented its share of design challenges in information-

POSIX.1b function calls

www.lnxw.net/products/posix/function-calls.php3

2/6

3/24/13
Function a i o _ c a n c e l a i o _ e r r o r a i o _ r e a d a i o _ r e t u r n a i o _ s u s p e n d a i o _ w r i t e c l o c k _ g e t r e s c l o c k _ g e t t i m e c l o c k _ s e t t i m e f d a t a s y n c f s y n c k i l l ,s i g q u e u e l i o _ l i s t i o m l o c k m l o c k a l l m m a p m p r o t e c t m q _ c l o s e m q _ g e t a t t r m q _ n o t i f y m q _ o p e n m q _ r e c e i v e m q _ s e n d m q _ s e t a t t r m s y n c m u n l o c k m u n l o c k a l l m u n m a p n a n o s l e e p

POSIX.1, POSIX.1b and POSIX.1c Function Calls

POSIX.1b function calls


POSIX Description Tries to cancel an asynchronous operation Retrieves the error status for an asynchronous operation Asynchronously reads from a file Retrieves the return status for an asynchronous operation Waits for an asynchronous operation to complete Asynchronously writes to a file Gets resolution of a POSIX.1b clock Gets the time according to a particular POSIX.1b clock Sets the time according to a particular POSIX.1b clock Synchronizes at least the data part of a file with the underlying media Synchronizes a file with the underlying media Sends signals to a process Performs a list of I/O operations, synchronously or asynchronously Locks a range of memory Locks the entire memory space down Maps a shared memory object (or possibly another file) into process's address space Changes memory protection on a mapped area Terminates access to a POSIX.1b message queue Gets POSIX.1b message queue attributes Registers a request to be notified when a message arrives on an empty message queue Creates/accesses a POSIX.1b message queue Receives a message from a POSIX.1b message queue Sends a message on a POSIX.1b message queue Sets a subset of POSIX.1b message queue attributes Makes a mapping consistent with the underlying object Unlocks a range of memory Unlocks the entire address space Undo mapping established by mmap Pauses execution for a number of nanoseconds Gets maximum priority value for a scheduler Gets minimum priority value for a scheduler Retrieves scheduling parameters for a particular process Retrieves scheduling algorithm for a particular purpose Gets the SCHED_RR interval for the named process Sets scheduling parameters for a process Sets scheduling algorithm/parameters for a process Yields the processor Terminates access to a POSIX.1b semaphore De-initializes a POSIX.1b unnamed semaphore Gets the value of a POSIX.1b semaphore Creates/accesses a POSIX.1b named semaphore Posts (signal) a POSIX.1b named or unnamed semaphore Destroys a POSIX.1b named semaphore Waits on a POSIX.1b named or unnamed semaphore Creates/accesses a POSIX.1b shared memory object Destroys a POSIX.1b shared memory object

assurance-based systems. But now, Intel's VT-x and VT-d CPU extensions are changing the game and showing potential to become the de facto path to virtualization. (Military Embedded Systems, January 2009) Separation Kernel for a Secure Real-time Operating System The technical foundation adopted for the so-called MILS architecture is a separation kernel like LynxSecure, which permits multiple functions to be realised on a common set of physical resources without unwanted mutual interference. (Boards and Solutions Magazine, February 2008) Advances in Virtualization aid Information Assurance Advances in the newest Intel processors are making virtualization much easier to implement in security applications than ever before. (Embedded Computing Design, January 2008) Protecting our most Vital Systems Some significant defence programmes are already committed to a new approach to high-threat, high-assetvalue systems. Rance DeLong explains MILS. (Components in Electronics, April 2007) Perspectives: Security and the Separation Kernel Today's avionics systems are designed to support more than one application, using a partitioned operating system and memory management units to ensure applications have adequate separation. (Avionics Magazine, April 2007) MILS: An Architecture for Security, Safety, and Real Time The unrelenting growth and integration of embedded controls, information processing, and communications has created a need for systems that provide robust protection for resources and services in the face of serious threats. (Embedded Technology Magazine, November 2006) Partitioning Operating Systems Versus Process-based Operating Systems Partitioning operating systems are the latest buzz, while processes, by contrast, have been around for over 30 years. Both provide memory protection, however, the intent behind them is very different. DO-178B and the Common Criteria: Future Security Levels Although there are similarities between the airborne safetycritical requirements in RTCA/DO-178B and the Common Criteria, ISO 14508, compliance with the higher levels of security in the Common Criteria demands meeting additional security requirements. (COTS Journal, April 2006) Reusing Safety-Critical Software Components Safety-critical systems often operate together as a single "system-of-systems," making it important that they meet the most stringent and rigorous requirements for safetycriticality. The failure of one module in a system could

s c h e d _ g e t _ p r i o r i t y _ m a x s c h e d _ g e t _ p r i o r i t y _ m i n s c h e d _ g e t p a r a m s c h e d _ g e t s c h e d u l e r s c h e d _ r r _ g e t _ i n t e r v a l s c h e d _ s e t p a r a m s c h e d _ s e t s c h e d u l e r s c h e d _ y i e l d s e m _ c l o s e s e m _ d e s t r o y s e m _ g e t v a l u e s e m _ o p e n s e m _ p o s t s e m _ u n l i n k s e m _ w a i t ,s e m _ t r y w a i t s h m _ o p e n s h m _ u n l i n k

s i g w a i t i n f o s i g t i m e d w a i t Synchronously awaits signal arrival; avoid calling handler

www.lnxw.net/products/posix/function-calls.php3

3/6

3/24/13
t i m e r _ c r e a t e t i m e r _ d e l e t e t i m e r _ g e t t i m e t i m e r _ s e t t i m e w a i t ,w a i t p i d

POSIX.1, POSIX.1b and POSIX.1c Function Calls


Creates a POSIX.1b timer based on a particular clock Deletes a POSIX.1b timer Time remaining on a POSIX.1b timer before expiration Sets expiration time/interval for a POSIX.1b timer Retrieves status of a terminated process and clean up corpse create other failures or vulnerabilities, or worse yet, failure of the system as a whole. (COTS Journal, August 2005) Using the Microprocessor MMU for Software Protection in Real-Time Systems With minimal impact to overall system performance, user tasks and the kernel can be protected from accidental corruption by using multiple protected address spaces. Improving code Migration and Reuse The unrelenting growth and integration of embedded controls, information processing, and communications has created a need for systems that provide robust protection for resources and services in the face of serious threats. (Embedded Computing Design, August 2006) FCS Program Rolls Forward in Formation A wireless data network, with advanced communications and technologies, links soldiers with 18 new, lightweight manned and unmanned ground vehicles, unmanned aircraft, sensors and weapons and it's all in one program. (COTS Journal, June 2005) Secure Operating Systems for Deeply Embedded Devices As we add more intelligence to our embedded devices, we find that they are becoming increasingly integrated into our information technology infrastructure. Though system security is not a new concept, security-in-depth is a new paradigm developers are now starting to address. (RTC Magazine, September 2004)

POSIX.1c function calls


Function p t h r e a d _ a t f o r k p t h r e a d _ a t t r _ d e s t r o y p t h r e a d _ a t t r _ g e t d e t a c h s t a t e p t h r e a d _ a t t r _ g e t i n h e r i t s c h e d POSIX Description Declares procedures to be called before and after a fork Destroys a thread attribute object Obtains the setting of the detached state of a thread Obtains the setting of the scheduling inheritance of a thread Obtains the parameters associated with the scheduling policy attribute of a thread Obtains the setting of the scheduling policy of a thread Obtains the setting of the scheduling scope of a thread Obtains the stack address of a thread Obtains the stack size of a thread Initializes a thread attribute object Adjusts the detached state of a thread Adjusts the scheduling inheritance of a thread Adjusts the parameters associated with the scheduling policy of a thread Adjusts the scheduling policy of a thread Adjusts the scheduling scope of a thread Adjusts the stack address of a thread Adjusts the stack size of a thread Cancels the specific thread Removes the routine from the top of a thread's cleanup stack, and if execute is nonzero, runs it Places a routine on the top of a thread's cleanup stack Destroys a condition variable attribute object Obtains the process-shared setting of a condition variable attribute object Initializes a condition variable attribute object Sets the process-shared attribute in a condition variable attribute object to either PTHREAD_PROCESS_SHARED or
PTHREAD_PROCESS_PRIVATE

p t h r e a d _ a t t r _ g e t s c h e d p a r a m

p t h r e a d _ a t t r _ g e t s c h e d p o l i c y p t h r e a d _ a t t r _ g e t s c o p e p t h r e a d _ a t t r _ g e t s t a c k a d d r p t h r e a d _ a t t r _ g e t s t a c k s i z e p t h r e a d _ a t t r _ i n i t p t h r e a d _ a t t r _ s e t d e t a c h s t a t e p t h r e a d _ a t t r _ s e t i n h e r i t s c h e d p t h r e a d _ a t t r _ s e t s c h e d p a r a m p t h r e a d _ a t t r _ s e t s c h e d p o l i c y p t h r e a d _ a t t r _ s e t s c o p e p t h r e a d _ a t t r _ s e t s t a c k a d d r p t h r e a d _ a t t r _ s e t s t a c k s i z e p t h r e a d _ c a n c e l p t h r e a d _ c l e a n u p _ p o p

VIRTUALIZATION / RTOS NEWS

p t h r e a d _ c l e a n u p _ p u s h p t h r e a d _ c o n d a t t r _ d e s t r o y p t h r e a d _ c o n d a t t r _ g e t p s h a r e d p t h r e a d _ c o n d a t t r _ i n i t

LynuxWorks Debuts Industry's First Real-time Zero-Day Rootkit and Bootkit Defense -2/26 LynxOS-178 RTOS Flies high in Super Mid-size Business jet Market -1/29 LynuxWorks Demonstrates Safety-Critical and Secure RTOS Solutions at AFCEA
-1/28

p t h r e a d _ c o n d a t t r _ s e t p s h a r e d

p t h r e a d _ c o n d _ b r o a d c a s t p t h r e a d _ c o n d _ d e s t r o y p t h r e a d _ c o n d _ i n i t

Unblocks all threads that are waiting on a condition variable Destroys a condition variable Initializes a condition variable with the attributes specified in the specified condition variable attribute object Unblocks at least one thread waiting on a condition variable Automatically unlocks the specified mutex, and places the calling thread into a wait state Automatically unlocks the specified mutex, and places the calling thread into a wait state Creates a thread with the attributes specified in attr Marks a threads internal data structures for deletion

p t h r e a d _ c o n d _ s i g n a l

LynxOS-178 RTOS Deployed by Rockwell Collins in Pro Line Fusion Series of Flight Deck Systems
-11/27

p t h r e a d _ c o n d _ t i m e d w a i t

p t h r e a d _ c o n d _ w a i t

EVENTS
Future Airborne Capability Environment (FACE) Air Force Technical Interchange Meeting and Expo,

p t h r e a d _ c r e a t e p t h r e a d _ d e t a c h

www.lnxw.net/products/posix/function-calls.php3

4/6

3/24/13
p t h r e a d _ e q u a l p t h r e a d _ e x i t

POSIX.1, POSIX.1b and POSIX.1c Function Calls


Compares one thread handle to another thread handle Terminates the calling thread Obtains both scheduling policy and scheduling parameters of an existing thread Obtains the thread specific data value associated with the specific key in the calling thread Causes the calling thread to wait for the specific threads termination Generates a unique thread-specific key that's visible to all threads in a process Deletes a thread specific key Delivers a signal to the specified thread Destroys a mutex attribute object Dayton, OH, USA, Apr 2 LynxSecure RealTime Applications and Device Driver Programming Workshop, San Jos, CA, USA, Apr 8-12 Device-Driver and Real-Time Programming for the LynxOS RTOS Family, San Jos and Online, CA, USA, Apr 22-26

p t h r e a d _ g e t s c h e d p a r a m

p t h r e a d _ g e t s p e c i f i c

p t h r e a d _ j o i n p t h r e a d _ k e y _ c r e a t e p t h r e a d _ k e y _ d e l e t e p t h r e a d _ k i l l p t h r e a d _ m u t e x a t t r _ d e s t r o y

p t h r e a d _ m u t e x a t t r _ g e t p r i o c e i l i n g Obtains the priority ceiling of a mutex attribute object p t h r e a d _ m u t e x a t t r _ g e t p r o t o c o l p t h r e a d _ m u t e x a t t r _ g e t p s h a r e d p t h r e a d _ m u t e x a t t r _ i n i t Obtains protocol of a mutex attribute object Obtains a process-shared setting of a mutex attribute object Initializes a mutex attribute object

p t h r e a d _ m u t e x a t t r _ s e t p r i o c e i l i n g Sets the priority ceiling attribute of a mutex attribute object p t h r e a d _ m u t e x a t t r _ s e t p r o t o c o l Sets the protocol attribute of a mutex attribute object Sets the process-shared attribute of a mutex attribute object to either PTHREAD_PROCESS_SHARED or
PTHREAD_PROCESS_PRIVATE

p t h r e a d _ m u t e x a t t r _ s e t p s h a r e d

p t h r e a d _ m u t e x _ d e s t r o y p t h r e a d _ m u t e x _ i n i t p t h r e a d _ m u t e x _ l o c k p t h r e a d _ m u t e x _ t r y l o c k p t h r e a d _ m u t e x _ u n l o c k p t h r e a d _ o n c e

Destroys a mutex Initializes a mutex with the attributes specified in the specified mutex attribute object Locks an unlocked mutex Tries to lock a not tested Unlocks a mutex Ensures that init_routine will run just once regardless of how many threads in the process call it Obtains a thread handle of a calling thread Sets a thread's cancelability state Sets a thread's cancelability type Adjusts the scheduling policy and scheduling parameters of an existing thread Sets the thread-specific data value associated with the specific key in the calling thread Examines or changes the calling thread's signal mask Requests that any pending cancellation request be delivered to the calling thread

p t h r e a d _ s e l f p t h r e a d _ s e t c a n c e l s t a t e p t h r e a d _ s e t c a n c e l t y p e p t h r e a d _ s e t s c h e d p a r a m

p t h r e a d _ s e t s p e c i f i c

p t h r e a d _ s i g m a s k

p t h r e a d _ t e s t c a n c e l

"ButisitPOSIXconformant?"

s a vvy e n g i n e e r j u s t
n eeds t o ask a few qu ick qu est ion s abou t an operat in g syst em in

POSIX for embedded developers


What is POSIX? POSIX.1, .1b and .1c POSIX Function Calls Reference Processes and Virtual Memory Parent-Child Processes Threads in POSIX Signals in POSIX

order t o det erm in e if it m igh t fu lly su pport t h e POSIX st an dards.

1. "Does each process in the operating

www.lnxw.net/products/posix/function-calls.php3

5/6

3/24/13

POSIX.1, POSIX.1b and POSIX.1c Function Calls

system reside in a different name space and have its own symbols table? 2. "Does the operating system support the f o r k ( )call?" 3. "Can the operating system distinguish between threads and processes?" 4. "Does the operating system support signals?"

LynxOS: POSIXconformant RTOS

POSIX PDF BROCHURE (169 kB) POSIX TRAINING: Realtime system course

O'REILLY PROGRAMMING GUIDES for LynuxWorks operating systems


POSIX Programmers Guide Pthreads Programming POSIX.4 Programmers Guide

PROCESSES AND VIRTUAL MEMORY

more
LynxSecure SEPARATION KERNEL FOR SOFTWARE VIRTUALIZATION LynxOS REAL-TIME OPERATING SYSTEM LynxOS-178 RTOS FOR SOFTWARE CERTIFICATION RTOS WHITE PAPERS

Copyright LynuxWorks, Inc. All rights reserved. Reproduction in whole or in part in any form or medium without express written permission of LynuxWorks is prohibited.

www.lnxw.net/products/posix/function-calls.php3

6/6

You might also like