Pascal / BaseUnix / FpNanoSleep
FpAccess, FpAlarm, FpChdir, FpChmod, FpChown, FpClose, FpClosedir, FpDup, FpDup2, FpExecv, FpExecve, FpExit, FpFcntl, pfdfillset, fpFD_CLR, fpFD_ISSET, fpFD_SET, fpFD_ZERO, FpFork, FPFStat, FpFtruncate, FpGetcwd, FpGetegid, FpGetEnv, fpgeterrno, FpGeteuid, FpGetgid, FpGetgroups, FpGetpgrp, FpGetpid, FpGetppid, fpGetPriority, FpGetuid, FpIOCtl, FpKill, FpLink, FpLseek, fpLstat, FpMkdir, FpMkfifo, Fpmmap, Fpmunmap, » FpNanoSleep, fpNice, FpOpen, FpOpendir, FpPause, FpPipe, FpRead, FpReaddir, fpReadLink, FpRename, FpRmdir, fpSelect, fpseterrno, FpSetgid, fpSetPriority, FpSetsid, fpsettimeofday, FpSetuid,
Funcion: FpNanoSleep()
Sintaxis:
function FpNanoSleep(
 
  req: ptimespec;
 
  rem: ptimespec
 
):cInt;

Descripcion: suspende el proceso hasta un periodo de tiempo especificado en req hasta que fue pasado. Entonces la funcion retorna. Si la llamada fue interrumpida (por alguna señal) entonces la funcion puede retornar anterior, y rem contendría el tiempo que resta hasta el final del periodo previsto. En este caso la funcion retornara -1, y LinuxError se definirá a EINTR

Si la funcion retorna sin errores, el valor retornado sera cero.

ERRORES
Si un error ocurre o la llamada fue interrumpida, retornara -1. Mas información puede ser obtenida usando fpGetErrno.

Vea También
FpPause
FpAlarm
Ejemplo:
program example72;
 
{ Program to demonstrate the NanoSleep function. }
 
uses BaseUnix;
 
Var
  Req,Rem : TimeSpec;
  Res : Longint;
 
begin
  With Req do
    begin
    tv_sec:=10;
    tv_nsec:=100;
    end;
  Write('NanoSleep returned : ');
  Flush(Output);
  Res:=(fpNanoSleep(@Req,@rem));
  Writeln(res);
  If (res<>0) then
    With rem do
      begin
      Writeln('Remaining seconds     : ',tv_sec);
      Writeln('Remaining nanoseconds : ',tv_nsec);
      end;
end.

Librerias Pascal

Libreria crt - CRT - Pantalla y teclado del PASCAL de Turbo que maneja la unidad
Libreria dos - DOS - Interface Turbo Pascal MS-DOS
Libreria Graph - Unidad para manipular los graficos de la pantalla compatible con TP
Libreria Objects - Objetos basicos compatible con TP
Libreria math - Rutinas adicionales matematicas
Libreria Printer - Provee de acceso a la impresora
Libreria strings - Rutinas para el manejo de cadenas
Libreria BaseUnix - Funcionalidad Basica de Linux
Libreria System - Manejo de Archivos - Funciones para la manipulacion de archivos en Pascal