Libraries updates and cleanup
* Updating common/lib * Updating lib/csu * Updating lib/libc * Updating libexec/ld.elf_so * Corrected test on __minix in featuretest to actually follow the meaning of the comment. * Cleaned up _REENTRANT-related defintions. * Disabled -D_REENTRANT for libfetch * Removing some unneeded __NBSD_LIBC defines and tests Change-Id: Ic1394baef74d11b9f86b312f5ff4bbc3cbf72ce2
This commit is contained in:
+30
-18
@@ -1,4 +1,4 @@
|
||||
.\" $NetBSD: funopen.3,v 1.15 2010/03/22 19:30:54 joerg Exp $
|
||||
.\" $NetBSD: funopen.3,v 1.22 2012/10/08 18:15:09 njoly Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 1990, 1991, 1993
|
||||
.\" The Regents of the University of California. All rights reserved.
|
||||
@@ -31,24 +31,32 @@
|
||||
.\"
|
||||
.\" @(#)funopen.3 8.1 (Berkeley) 6/9/93
|
||||
.\"
|
||||
.Dd June 9, 1993
|
||||
.Dd March 16, 2012
|
||||
.Dt FUNOPEN 3
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm funopen ,
|
||||
.Nm funopen2 ,
|
||||
.Nm fropen ,
|
||||
.Nm fwopen
|
||||
.Nm fropen2 ,
|
||||
.Nm fwopen ,
|
||||
.Nm fwopen2
|
||||
.Nd open a stream
|
||||
.Sh LIBRARY
|
||||
.Lb libc
|
||||
.Sh SYNOPSIS
|
||||
.In stdio.h
|
||||
.Ft FILE *
|
||||
.Fn funopen "void *cookie" "int (*readfn)(void *, char *, int)" "int (*writefn)(void *, const char *, int)" "fpos_t (*seekfn)(void *, fpos_t, int)" "int (*closefn)(void *)"
|
||||
.Fn funopen "void *cookie" "int (*readfn)(void *, char *, int)" "int (*writefn)(void *, const char *, int)" "off_t (*seekfn)(void *, off_t, int)" "int (*closefn)(void *)"
|
||||
.Fn funopen2 "void *cookie" "ssize_t (*readfn)(void *, void *, size_t)" "ssize_t (*writefn)(void *, const void *, size_t)" "off_t (*seekfn)(void *, off_t, int)" "int (*flushfn)(void *)" "int (*closefn)(void *)"
|
||||
.Ft FILE *
|
||||
.Fn fropen "void *cookie" "int (*readfn)(void *, char *, int)"
|
||||
.Fn fropen "void *cookie" "int (*readfn)(void *, char *, int)"
|
||||
.Ft FILE *
|
||||
.Fn fwopen "void *cookie" "int (*writefn)(void *, const char *, int)"
|
||||
.Fn fropen2 "void *cookie" "ssize_t (*readfn)(void *, void *, size_t)"
|
||||
.Ft FILE *
|
||||
.Fn fwopen "void *cookie" "int (*writefn)(void *, const char *, int)"
|
||||
.Ft FILE *
|
||||
.Fn fwopen2 "void *cookie" "ssize_t (*writefn)(void *, const void *, size_t)"
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Fn funopen
|
||||
@@ -68,6 +76,14 @@ These
|
||||
functions will be used to read, write, seek and
|
||||
close the new stream.
|
||||
.Pp
|
||||
The
|
||||
.Fn funopen2
|
||||
function provides sightly different read and write signatures, which match
|
||||
better the corresponding system calls, plus the ability to augment the
|
||||
streams default flushing function.
|
||||
If a flushing function is provided, then it is called after all data has
|
||||
been written to the stream.
|
||||
.Pp
|
||||
In general, omitting a function means that any attempt to perform the
|
||||
associated operation on the resulting stream will fail.
|
||||
If the close function is omitted, closing the stream will flush
|
||||
@@ -89,13 +105,7 @@ except that they are passed the
|
||||
.Fa cookie
|
||||
argument specified to
|
||||
.Fn funopen
|
||||
in place of the traditional file descriptor argument,
|
||||
and
|
||||
.Fa seekfn
|
||||
uses
|
||||
.Li fpos_t
|
||||
instead of
|
||||
.Li off_t .
|
||||
in place of the traditional file descriptor argument.
|
||||
.Pp
|
||||
Read and write
|
||||
.Tn I/O
|
||||
@@ -167,9 +177,11 @@ The
|
||||
.Fn funopen
|
||||
functions first appeared in
|
||||
.Bx 4.4 .
|
||||
.Sh BUGS
|
||||
The
|
||||
.Fn funopen
|
||||
function
|
||||
may not be portable to systems other than
|
||||
.Bx .
|
||||
.Fn funopen2
|
||||
functions first appeared in
|
||||
.Nx 7.0 .
|
||||
.Sh CAVEATS
|
||||
All three functions are specific to
|
||||
.Nx
|
||||
and thus unportable.
|
||||
|
||||
Reference in New Issue
Block a user