[ale] OT: Stupid Window Tricks

cfowler cfowler at outpostsentinel.com
Thu Oct 31 10:23:26 EST 2002


Can anyone win32 guru here tell me how to convert this code:



int
main(void)
{       
        int fd;
        pid_t pid;


        // Open serial port
        fd = open("/dev/ttys0", O_RDWR | O_NOCTTY);

        // TODO: Setup serial port

        // Fork
        switch((pid = fork())) {
                case -1: exit(0);
                case 0: // Parent 
                         close(0);
                         close(1);
                         close(2);
                         dup2(fd, 0);
                         dup2(fd, 1);
                         dup2(fd, 2);
                         execl("/bin/sh", "/bin/sh", 0);
                         exit(0);
                default: // Parent
                         waitpid(pid, NULL, 0);
                         break;
        }


        // Finished
        close(fd);

        return 0;
        
}       


Into Win32 code not using Cygwin?


---
This message has been sent through the ALE general discussion list.
See http://www.ale.org/mailing-lists.shtml for more info. Problems should be 
sent to listmaster at ale dot org.






More information about the Ale mailing list