Logo Search packages:      
Sourcecode: ardour version File versions  Download package

Glib::RefPtr< IOChannel > Glib::IOChannel::create_from_fd ( int  fd  )  [static, inherited]

Creates an I/O channel from a file descriptor. On Unix, IOChannels created with this function work for any file descriptor or socket.

On Win32, this can be used either for files opened with the MSVCRT (the Microsoft run-time C library) _open() or _pipe(), including file descriptors 0, 1 and 2 (corresponding to stdin, stdout and stderr), or for Winsock SOCKETs. If the parameter is a legal file descriptor, it is assumed to be such, otherwise it should be a SOCKET. This relies on SOCKETs and file descriptors not overlapping. If you want to be certain, call either create_from_win32_fd() or create_from_win32_socket() instead as appropriate.

The term file descriptor as used in the context of Win32 refers to the emulated Unix-like file descriptors MSVCRT provides. The native corresponding concept is file HANDLE. There isn't as of yet a way to get IOChannels for Win32 file HANDLEs.

Definition at line 190 of file iochannel.cc.

{
  return Glib::wrap(g_io_channel_unix_new(fd), false);
}


Generated by  Doxygen 1.6.0   Back to index