martes, 27 de septiembre de 2011

POSIX


Es el acrónimo de Portable Operating System Interface; la X viene de UNIX como seña de identidad de la API.
El término fue sugerido por Richard Stallman en respuesta a la demanda de la IEEE, que buscaba un nombre fácil de recordar. Una traducción aproximada del acrónimo podría ser "Interfaz de sistema operativo portable".
POSIX.1, Core Services (implementa las llamadas del ANSI C estándar). Incluye:
  • Creación y control de procesos.
  • Señales.
  • Excepciones de punto flotante.
  • Excepciones por violación de segmento.
  • Excepciones por instrucción ilegal.
  • Errores del bus.
  • Temporizadores.
  • Operaciones de ficheros y directorios (sobre cualquier fs montado).
  • Tuberías (Pipes).
  • Biblioteca C (Standard C).
  • Instrucciones de entrada/salida y de control de dispositivo (ioctl).

TOTALMENTE POSIX-COMPATIBLES
Los siguientes Sistemas Operativos son 100% compatibles con uno o varios estándares POSIX.
  • A/UX
  • AIX
  • BSD/OS
  • DSPnano
  • HP-UX
  • INTEGRITY
  • IRIX
  • LynxOS
  • Mac OS X v10.5 en Procesadores Intel.
  • MINIX
  • MPE/iX
  • QNX (IEEE Std. 1003.13-2003 PSE52;
  • RTEMS (POSIX 1003.1-2003 Profile 52)
  • Solaris
  • Unison RTOS
  • UnixWare
  • velOSity
  • VxWorks (IEEE Std. 1003.13-2003 PSE52
Listado de Código 1.2: Ejemplo de programa con hilos POSIX
#include <pthread.h>
#include <stdlib.h>
#include <unistd.h>

void *thread_function(void *arg) {
  int i;
  for ( i=0; i<20; i++ ) {
    printf("Thread says hi!\n");
    sleep(1);
  }
  return NULL;
}

int main(void) {

  pthread_t mythread;

  if ( pthread_create( &mythread, NULL, thread_function, NULL) ) {
    printf("error creating thread.");
    abort();
  }

  if ( pthread_join ( mythread, NULL ) ) {
    printf("error joining thread.");
    abort();
  }

  exit(0);

}

No hay comentarios:

Publicar un comentario