Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/m/modem_write.html on line 1

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/m/modem_write.html on line 1

Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/m/modem_write.html on line 8

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/m/modem_write.html on line 8

modem_write()

Write a string to a device

Synopsis:

#include <sys/modem.h>

int modem_write( int fd,
                 char* str );

Arguments:

fd
The file descriptor for the device that you want to write to; see modem_open().
str
The string that you want to write.

Library:

libc

Use the -l c option to qcc to link against this library. This library is usually included automatically.


Note: This function is in libc.a, but not in libc.so (in order to save space).

Description:

The modem_write() function writes the string str to the device specified by the file descriptor fd. Just before writing each character, all buffered input from the same device is flushed. After writing each character, an attempt to read an echo is made. The intent is to write a string without its appearing back in the input stream even if the device is echoing each character written.

If the \ character appears in str, then the character following it is interpreted by modem_write(), and instead of both being written, they're treated as a special escape sequence that causes the following actions to be taken:

Escape Description
\r Output a carriage return.
\n Output a newline.
\xhh Output the single character whose hex representation follows as hh.
\B Send a 500 msec break on the line using tcsendbreak().
\D Drop the line for 1 second using tcdropline().
\Phh Pause for hh 1/10 of a second where hh is two hex characters.

Returns:

Zero on success, -1 on failure (errno is set ).

Errors:

EAGAIN
The O_NONBLOCK flag is set for the file descriptor, and the process would be delayed in the write operation.
EBADF
The file descriptor, fildes, isn't a valid file descriptor open for writing.
EINTR
The write operation was interrupted by a signal, and either no data was transferred, or the resource manager responsible for that file doesn't report partial transfers.
EIO
A physical I/O error occurred. The precise meaning depends on the device.
EPIPE
An attempt was made to write to a pipe (or FIFO) that isn't open for reading by any process. A SIGPIPE signal is also sent to the process.

Classification:

QNX Neutrino

Safety:
Cancellation point Yes
Interrupt handler No
Signal handler Yes
Thread Yes

See also:

modem_open(), modem_read(), modem_script()


Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/m/modem_write.html on line 246

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/m/modem_write.html on line 246