Changeset 717

Show
Ignore:
Timestamp:
07/27/07 16:14:24 (1 year ago)
Author:
Gregor
Message:

dsssps/process.d: Made to use the same POSIX functions on Windows.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • other/dps/trunk/dsssps/process.d

    r710 r717  
    77import tango.sys.Process; 
    88 
    9 // FIXME: Windows? 
    10 version (Posix) { 
    11     import tango.stdc.posix.fcntl; 
    12     import tango.stdc.posix.sys.wait; 
    13 } 
    14  
    159import wx.wx; 
    1610 
    1711import dsssps.dps; 
     12 
     13extern (C) { 
     14    int fcntl(int fd, int cmd, long arg = 0); 
     15    const int F_GETFL = 3; 
     16    const int F_SETFL = 4; 
     17    const int O_NONBLOCK = 04000; 
     18 
     19    int waitpid(int pid, int *status, int options); 
     20    const int WNOHANG = 1; 
     21} 
    1822 
    1923/// Run a process and pipe its output into a visible buffer 
     
    2933 
    3034        // make it nonblocking if possible 
    31         version (Posix) { 
    32             fcntl(proc.stdout.fileHandle(), F_SETFL, 
    33                 fcntl(proc.stdout.fileHandle(), F_GETFL) | O_NONBLOCK); 
    34         } else { 
    35             static assert(0); 
    36         } 
     35        fcntl(proc.stdout.fileHandle(), F_SETFL, 
     36            fcntl(proc.stdout.fileHandle(), F_GETFL) | O_NONBLOCK); 
    3737 
    3838        // set up the text area