iPXE
unistd.h
Go to the documentation of this file.
00001 #ifndef _UNISTD_H
00002 #define _UNISTD_H
00003 
00004 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
00005 
00006 #include <stddef.h>
00007 #include <stdarg.h>
00008 
00009 extern int execv ( const char *command, char * const argv[] );
00010 
00011 /**
00012  * Execute command
00013  *
00014  * @v command           Command name
00015  * @v arg ...           Argument list (starting with argv[0])
00016  * @ret rc              Command exit status
00017  *
00018  * This is a front end to execv().
00019  */
00020 #define execl( command, arg, ... ) ( {                                  \
00021                 char * const argv[] = { (arg), ## __VA_ARGS__ };        \
00022                 int rc = execv ( (command), argv );                     \
00023                 rc;                                                     \
00024         } )
00025 
00026 /* Pick up udelay() and sleep() */
00027 #include <ipxe/timer.h>
00028 
00029 static inline __always_inline void usleep ( unsigned long usecs ) {
00030         udelay ( usecs );
00031 }
00032 
00033 #endif /* _UNISTD_H */