@c ----------------------------------------------------------------------
@node creat, io
@heading @code{creat}
@subheading Syntax

@example
#include <osfcn.h>
#include <sys/stat.h>

int creat(const char *filename, unsigned long int mode);
@end example

@subheading Description

This function creates the given file and opens it for writing.  If the
file exists, it is truncated to zero size, unless it is read-only, in
which case the function fails.  If the file does not exist, it will be
created read-only if @var{mode} does not have @code{S_IWRITE} set. 

@subheading Return Value

A file descriptor >= 0, or a negative number on error. 

@subheading Example

@example
int fd = creat("data", S_IWRITE);
write(fd, buf, 1024);
close(fd);
@end example

@c ----------------------------------------------------------------------
@node crlf2nl, io
@heading @code{crlf2nl}
@subheading Syntax

@example
unsigned crlf2nl(char *buf, unsigned len);
@end example

@subheading Description

This function removes Ctrl-M characters from the given @var{buf}. 

@subheading Return Value

The number of characters remaining in the buffer are returned.

