POSIX Tutorial                
            Empezando con POSIX
        
        
            
    Buscar..
Versiones
| Versión | Estándar | Año de lanzamiento | 
|---|---|---|
| POSIX.1 | IEEE Std 1003.1-1988 | 1988-01-01 | 
| POSIX.1b | IEEE Std 1003.1b-1993 | 1993-01-01 | 
| POSIX.1c | IEEE Std 1003.1c-1995 | 1995-01-01 | 
| POSIX.2 | IEEE Std 1003.2-1992 | 1992-01-01 | 
| POSIX.1-2001 | IEEE Std 1003.1-2001 | 2001-12-06 | 
| POSIX.1-2004 | IEEE Std 1003.1-2004 | 2004-01-01 | 
| POSIX.1-2008 | IEEE Std 1003.1-2008 (también conocido como " Especificaciones de la base, Número 7 ") | 2008-12-01 | 
| POSIX.1-2013 | IEEE Std 1003.1-2013 | 2013-04-19 | 
| POSIX.1-2016 | IEEE Std 1003.1-2016 | 2016-09-30 | 
¿Qué es POSIX?
POSIX significa " Interfaz de sistema operativo portátil " y define un conjunto de estándares para proporcionar compatibilidad entre diferentes plataformas informáticas. La versión actual del estándar es IEEE 1003.1 2016 y se puede acceder desde la especificación POSIX de OpenGroup. Las versiones anteriores incluyen POSIX 2004 y POSIX 1997 . La edición POSIX 2016 es esencialmente errata POSIX 2008 más (también hubo una versión POSIX 2013).
POSIX define varias interfaces de herramientas, comandos y API para sistemas operativos similares a UNIX y otros.
Se considera que lo siguiente está dentro del alcance de la estandarización de POSIX:
- Interfaz del sistema (funciones, macros y variables externas).
- Intérprete de comandos, o Shell (la utilidad sh )
- Utilidades (como más , cat , ls )
Fuera del alcance de POSIX:
- Interfaces DBMS
- Interfaces gráficas
- Portabilidad de código binario
Hola Mundo
 Un simple programa de Hello, World sin comprobación de errores: 
#include <unistd.h> /* For write() and STDOUT_FILENO */
#include <stdlib.h> /* For EXIT_SUCCESS and EXIT_FAILURE */
int main(void) {
        char hello[] = "Hello, World\n";
        
        /* Attempt to write `hello` to standard output file */
        write(STDOUT_FILENO, hello, sizeof(hello) - 1);
        return EXIT_SUCCESS; 
}
Y con la comprobación de errores:
#include <unistd.h> /* For write() and STDOUT_FILENO */
#include <stdlib.h> /* For EXIT_SUCCESS and EXIT_FAILURE */
int main(void) {
        char hello[] = "Hello, World\n";
        ssize_t ret = 0;
        
        /* Attempt to write `hello` to standard output file */
        ret = write(STDOUT_FILENO, hello, sizeof(hello) - 1);
        if (ret == -1) {
                /* write() failed. */
                return EXIT_FAILURE;
        } else if (ret != sizeof(hello) - 1) {
                /* Not all bytes of `hello` were written. */
                return EXIT_FAILURE;
        }
        return EXIT_SUCCESS; 
}
Compilando y corriendo
 Si el código que se muestra arriba (cualquiera de las versiones) se almacena en el archivo hello.c , puede compilar el código en un programa hello usando c99 o make . Por ejemplo, en un modo estrictamente compatible con POSIX, en teoría podría compilar y ejecutar el programa usando: 
$ make hello
c99 -o hello hello.c
$ ./hello
Hello, World
$
 La mayoría de las implementaciones de make reales usarán un compilador de C diferente (quizás cc , tal vez gcc , clang , xlc o algún otro nombre), y muchas usarán más opciones para el compilador. Claramente, simplemente puede escribir el comando que make que se ejecuta directamente en la línea de comandos.