Index: head/cddl/usr.bin/ctfconvert/ctfconvert.1 =================================================================== --- head/cddl/usr.bin/ctfconvert/ctfconvert.1 (revision 276293) +++ head/cddl/usr.bin/ctfconvert/ctfconvert.1 (revision 276294) @@ -1,85 +1,85 @@ .\" .\" Copyright (c) 2010 The FreeBSD Foundation .\" All rights reserved. .\" .\" This software was developed by Rui Paulo under sponsorship from the .\" FreeBSD Foundation. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" .Dd July 7, 2010 .Dt CTFCONVERT 1 .Os .Sh NAME .Nm ctfconvert .Nd convert debug data to CTF data .Sh SYNOPSIS .Nm .Op Fl gis .Fl l Ar label .Fl L Ar labelenv .Op Fl o Ar outfile object_file .Sh DESCRIPTION The .Nm utility converts debug information from a binary file to CTF data and replaces the debug section of that file with a CTF section called SUNW_ctf. This new section is added to the input file, unless the -o option is present. You can also opt to keep the original debugging section with the -g option. .Pp The following options are available: .Bl -tag -width indent .It Fl l Ar label Sets the label as .Ar label . .It Fl L Ar labelenv Instructs .Nm to read the label from the environment variable .Ar labelenv . .It Fl g Don't delete the original debugging section. .It Fl i Ignore object files built from other languages than C. .It Fl s Use the .dynsym ELF section instead of the .symtab ELF section. .It Fl o Ar outfile Write the output to file in .Ar outfile . .El .Sh EXIT STATUS .Ex -std .Sh SEE ALSO -.Xr ctfmerge 1 , -.Xr ctfdump 1 +.Xr ctfdump 1 , +.Xr ctfmerge 1 .Sh HISTORY The .Nm utility first appeared in .Fx 7.0 . .Sh AUTHORS The CTF utilities came from OpenSolaris. Index: head/lib/libc/iconv/iconvlist.3 =================================================================== --- head/lib/libc/iconv/iconvlist.3 (revision 276293) +++ head/lib/libc/iconv/iconvlist.3 (revision 276294) @@ -1,93 +1,93 @@ .\" Copyright (c) 2009 Gabor Kovesdan .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" Portions of this text are reprinted and reproduced in electronic form .\" from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- .\" Portable Operating System Interface (POSIX), The Open Group Base .\" Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of .\" Electrical and Electronics Engineers, Inc and The Open Group. In the .\" event of any discrepancy between this version and the original IEEE and .\" The Open Group Standard, the original IEEE and The Open Group Standard is .\" the referee document. The original Standard can be obtained online at .\" http://www.opengroup.org/unix/online.html. .\" .\" $FreeBSD$ .\" .Dd October 20, 2009 .Dt ICONVLIST 3 .Os .Sh NAME .Nm iconvlist .Nd retrieving a list of character encodings supported by .Xr iconv 3 .Sh LIBRARY .Lb libc .Sh SYNOPSIS .In iconv.h .Ft void .Fo iconvlist .Fa "int \*[lp]*do_one\*[rp]\*[lp]unsigned int *count, const char * const *names, void *arg\*[rp]" .Fa "void *arg" .Fc .Sh DESCRIPTION The .Fn iconvlist function obtains a list of character encodings that are supported by the .Xr iconv 3 call. The .Fn do_one callback function will be called, where the .Fa count argument will be set to the number of the encoding names found, the .Fa names argument will be the list of the supported encoding names and the .Fa arg argument will be the \"outer\" .Fa arg argument of the .Fn iconvlist function. This argument can be used to interchange custom data between the caller of .Fn iconvlist and the callback function. .Pp If an error occurs, .Fa names will be NULL when calling .Fn do_one . .Sh SEE ALSO -.Xr iconv 3 , +.Xr __iconv_free_list 3 , .Xr __iconv_get_list 3 , -.Xr __iconv_free_list 3 +.Xr iconv 3 .Sh STANDARDS The .Nm function is a non-standard extension, which appeared in the GNU implementation and was adopted in .Fx 9.0 for compatibility's sake. .Sh AUTHORS This manual page was written by .An Gabor Kovesdan Aq Mt gabor@FreeBSD.org . Index: head/lib/libc/locale/digittoint.3 =================================================================== --- head/lib/libc/locale/digittoint.3 (revision 276293) +++ head/lib/libc/locale/digittoint.3 (revision 276294) @@ -1,68 +1,68 @@ .\" Copyright (c) 1993 .\" The Regents of the University of California. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" @(#)digittoint.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" .Dd April 6, 2001 .Dt DIGITTOINT 3 .Os .Sh NAME .Nm digittoint .Nd convert a numeric character to its integer value .Sh LIBRARY .Lb libc .Sh SYNOPSIS .In ctype.h .Ft int .Fn digittoint "int c" .Ft int .Fn digittoint_l "int c" "locale_t loc" .Sh DESCRIPTION The .Fn digittoint function converts a numeric character to its corresponding integer value. The character can be any decimal digit or hexadecimal digit. With hexadecimal characters, the case of the values does not matter. .Pp The .Fn digittoint_l function takes an explicit locale argument, whereas the .Fn digittoint function use the current global or per-thread locale. .Sh RETURN VALUES The .Fn digittoint function always returns an integer from the range of 0 to 15. If the given character was not a digit as defined by .Xr isxdigit 3 , the function will return 0. .Sh SEE ALSO .Xr ctype 3 , .Xr isdigit 3 , -.Xr isxdigit 3, +.Xr isxdigit 3 , .Xr xlocale 3 Index: head/lib/libc/locale/xlocale.3 =================================================================== --- head/lib/libc/locale/xlocale.3 (revision 276293) +++ head/lib/libc/locale/xlocale.3 (revision 276294) @@ -1,280 +1,280 @@ .\" Copyright (c) 2011 The FreeBSD Foundation .\" All rights reserved. .\" .\" This documentation was written by David Chisnall under sponsorship from .\" the FreeBSD Foundation. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" .Dd September 17, 2011 .Dt XLOCALE 3 .Os .Sh NAME .Nm xlocale .Nd Thread-safe extended locale support .Sh LIBRARY .Lb libc .Sh SYNOPSIS .In xlocale.h .Sh DESCRIPTION The extended locale support includes a set of functions for setting thread-local locales, as well convenience functions for performing locale-aware calls with a specified locale. .Pp The core of the xlocale API is the .Fa locale_t type. This is an opaque type encapsulating a locale. Instances of this can be either set as the locale for a specific thread or passed directly to the .Fa _l suffixed variants of various standard C functions. Two special .Fa locale_t values are available: .Bl -bullet -offset indent .It NULL refers to the current locale for the thread, or to the global locale if no locale has been set for this thread. .It LC_GLOBAL_LOCALE refers to the global locale. .El .Pp The global locale is the locale set with the .Xr setlocale 3 function. .Sh SEE ALSO .Xr duplocale 3 , .Xr freelocale 3 , .Xr localeconv 3 , .Xr newlocale 3 , .Xr querylocale 3 , -.Xr uselocale 3 , +.Xr uselocale 3 .Sh CONVENIENCE FUNCTIONS The xlocale API includes a number of .Fa _l suffixed convenience functions. These are variants of standard C functions that have been modified to take an explicit .Fa locale_t parameter as the final argument or, in the case of variadic functions, as an additional argument directly before the format string. Each of these functions accepts either NULL or LC_GLOBAL_LOCALE. In these functions, NULL refers to the C locale, rather than the thread's current locale. If you wish to use the thread's current locale, then use the unsuffixed version of the function. .Pp These functions are exposed by including .In xlocale.h .Em after including the relevant headers for the standard variant. For example, the .Xr strtol_l 3 function is exposed by including .In xlocale.h after .In stdlib.h , which defines .Xr strtol 3 . .Pp For reference, a complete list of the locale-aware functions that are available in this form, along with the headers that expose them, is provided here: .Bl -tag -width " " .It In wctype.h .Xr iswalnum_l 3 , .Xr iswalpha_l 3 , .Xr iswcntrl_l 3 , .Xr iswctype_l 3 , .Xr iswdigit_l 3 , .Xr iswgraph_l 3 , .Xr iswlower_l 3 , .Xr iswprint_l 3 , .Xr iswpunct_l 3 , .Xr iswspace_l 3 , .Xr iswupper_l 3 , .Xr iswxdigit_l 3 , .Xr towlower_l 3 , .Xr towupper_l 3 , .Xr wctype_l 3 , .It In ctype.h .Xr digittoint_l 3 , .Xr isalnum_l 3 , .Xr isalpha_l 3 , .Xr isblank_l 3 , .Xr iscntrl_l 3 , .Xr isdigit_l 3 , .Xr isgraph_l 3 , .Xr ishexnumber_l 3 , .Xr isideogram_l 3 , .Xr islower_l 3 , .Xr isnumber_l 3 , .Xr isphonogram_l 3 , .Xr isprint_l 3 , .Xr ispunct_l 3 , .Xr isrune_l 3 , .Xr isspace_l 3 , .Xr isspecial_l 3 , .Xr isupper_l 3 , .Xr isxdigit_l 3 , .Xr tolower_l 3 , .Xr toupper_l 3 .It In inttypes.h .Xr strtoimax_l 3 , .Xr strtoumax_l 3 , .Xr wcstoimax_l 3 , .Xr wcstoumax_l 3 .It In langinfo.h .Xr nl_langinfo_l 3 .It In monetary.h .Xr strfmon_l 3 .It In stdio.h .Xr asprintf_l 3 , .Xr fprintf_l 3 , .Xr fscanf_l 3 , .Xr printf_l 3 , .Xr scanf_l 3 , .Xr snprintf_l 3 , .Xr sprintf_l 3 , .Xr sscanf_l 3 , .Xr vasprintf_l 3 , .Xr vfprintf_l 3 , .Xr vfscanf_l 3 , .Xr vprintf_l 3 , .Xr vscanf_l 3 , .Xr vsnprintf_l 3 , .Xr vsprintf_l 3 , .Xr vsscanf_l 3 .It In stdlib.h .Xr atof_l 3 , .Xr atoi_l 3 , .Xr atol_l 3 , .Xr atoll_l 3 , .Xr mblen_l 3 , .Xr mbstowcs_l 3 , .Xr mbtowc_l 3 , .Xr strtod_l 3 , .Xr strtof_l 3 , .Xr strtol_l 3 , .Xr strtold_l 3 , .Xr strtoll_l 3 , .Xr strtoq_l 3 , .Xr strtoul_l 3 , .Xr strtoull_l 3 , .Xr strtouq_l 3 , .Xr wcstombs_l 3 , .Xr wctomb_l 3 .It In string.h .Xr strcoll_l 3 , .Xr strxfrm_l 3 , .Xr strcasecmp_l 3 , .Xr strcasestr_l 3 , .Xr strncasecmp_l 3 .It In time.h .Xr strftime_l 3 .Xr strptime_l 3 .It In wchar.h .Xr btowc_l 3 , .Xr fgetwc_l 3 , .Xr fgetws_l 3 , .Xr fputwc_l 3 , .Xr fputws_l 3 , .Xr fwprintf_l 3 , .Xr fwscanf_l 3 , .Xr getwc_l 3 , .Xr getwchar_l 3 , .Xr mbrlen_l 3 , .Xr mbrtowc_l 3 , .Xr mbsinit_l 3 , .Xr mbsnrtowcs_l 3 , .Xr mbsrtowcs_l 3 , .Xr putwc_l 3 , .Xr putwchar_l 3 , .Xr swprintf_l 3 , .Xr swscanf_l 3 , .Xr ungetwc_l 3 , .Xr vfwprintf_l 3 , .Xr vfwscanf_l 3 , .Xr vswprintf_l 3 , .Xr vswscanf_l 3 , .Xr vwprintf_l 3 , .Xr vwscanf_l 3 , .Xr wcrtomb_l 3 , .Xr wcscoll_l 3 , .Xr wcsftime_l 3 , .Xr wcsnrtombs_l 3 , .Xr wcsrtombs_l 3 , .Xr wcstod_l 3 , .Xr wcstof_l 3 , .Xr wcstol_l 3 , .Xr wcstold_l 3 , .Xr wcstoll_l 3 , .Xr wcstoul_l 3 , .Xr wcstoull_l 3 , .Xr wcswidth_l 3 , .Xr wcsxfrm_l 3 , .Xr wctob_l 3 , .Xr wcwidth_l 3 , .Xr wprintf_l 3 , .Xr wscanf_l 3 .It In wctype.h .Xr iswblank_l 3 , .Xr iswhexnumber_l 3 , .Xr iswideogram_l 3 , .Xr iswnumber_l 3 , .Xr iswphonogram_l 3 , .Xr iswrune_l 3 , .Xr iswspecial_l 3 , .Xr nextwctype_l 3 , .Xr towctrans_l 3 , .Xr wctrans_l 3 .It In xlocale.h .Xr localeconv_l 3 .El .Sh STANDARDS The functions conform to .St -p1003.1-2008 . .Sh HISTORY The xlocale APIs first appeared in Darwin 8.0. This implementation was written by David Chisnall, under sponsorship from the FreeBSD Foundation and first appeared in .Fx 9.1 . .Sh CAVEATS The .Xr setlocale 3 function, and others in the family, refer to the global locale. Other functions that depend on the locale, however, will take the thread-local locale if one has been set. This means that the idiom of setting the locale using .Xr setlocale 3 , calling a locale-dependent function, and then restoring the locale will not have the expected behavior if the current thread has had a locale set using .Xr uselocale 3 . You should avoid this idiom and prefer to use the .Fa _l suffixed versions instead. Index: head/lib/libc/rpc/rpc.3 =================================================================== --- head/lib/libc/rpc/rpc.3 (revision 276293) +++ head/lib/libc/rpc/rpc.3 (revision 276294) @@ -1,517 +1,517 @@ .\" @(#)rpc.3n 1.31 93/08/31 SMI; from SVr4 .\" Copyright 1989 AT&T .\" $NetBSD: rpc.3,v 1.10 2000/06/02 23:11:12 fvdl Exp $ .\" $FreeBSD$ .Dd May 7, 1993 .Dt RPC 3 .Os .Sh NAME .Nm rpc .Nd library routines for remote procedure calls .Sh LIBRARY .Lb libc .Sh SYNOPSIS .In rpc/rpc.h .In netconfig.h .Sh DESCRIPTION These routines allow C language programs to make procedure calls on other machines across a network. First, the client sends a request to the server. On receipt of the request, the server calls a dispatch routine to perform the requested service, and then sends back a reply. .Pp All RPC routines require the header .In rpc/rpc.h . Routines that take a .Vt "struct netconfig" also require that .In netconfig.h be included. .Sh Nettype Some of the high-level RPC interface routines take a .Fa nettype string as one of the arguments (for example, .Fn clnt_create , .Fn svc_create , .Fn rpc_reg , .Fn rpc_call ) . This string defines a class of transports which can be used for a particular application. .Pp The .Fa nettype argument can be one of the following: .Bl -tag -width datagram_v .It netpath Choose from the transports which have been indicated by their token names in the .Ev NETPATH environment variable. .Ev NETPATH is unset or .Dv NULL , it defaults to .Qq visible . .Qq netpath is the default .Fa nettype . .It visible Choose the transports which have the visible flag (v) set in the .Pa /etc/netconfig file. .It circuit_v This is same as .Qq visible except that it chooses only the connection oriented transports (semantics .Qq tpi_cots or .Qq tpi_cots_ord ) from the entries in the .Pa /etc/netconfig file. .It datagram_v This is same as .Qq visible except that it chooses only the connectionless datagram transports (semantics .Qq tpi_clts ) from the entries in the .Pa /etc/netconfig file. .It circuit_n This is same as .Qq netpath except that it chooses only the connection oriented datagram transports (semantics .Qq tpi_cots or .Qq tpi_cots_ord ) . .It datagram_n This is same as .Qq netpath except that it chooses only the connectionless datagram transports (semantics .Qq tpi_clts ) . .It udp This refers to Internet UDP, both version 4 and 6. .It tcp This refers to Internet TCP, both version 4 and 6. .El .Pp If .Fa nettype is .Dv NULL , it defaults to .Qq netpath . The transports are tried in left to right order in the .Ev NETPATH variable or in top to down order in the .Pa /etc/netconfig file. .Sh Derived Types The derived types used in the RPC interfaces are defined as follows: .Bd -literal typedef uint32_t rpcprog_t; typedef uint32_t rpcvers_t; typedef uint32_t rpcproc_t; typedef uint32_t rpcprot_t; typedef uint32_t rpcport_t; typedef int32_t rpc_inline_t; .Ed .Sh "Data Structures" Some of the data structures used by the RPC package are shown below. .Sh "The AUTH Structure" .Bd -literal /* * Authentication info. Opaque to client. */ struct opaque_auth { enum_t oa_flavor; /* flavor of auth */ caddr_t oa_base; /* address of more auth stuff */ u_int oa_length; /* not to exceed MAX_AUTH_BYTES */ }; /* * Auth handle, interface to client side authenticators. */ typedef struct { struct opaque_auth ah_cred; struct opaque_auth ah_verf; struct auth_ops { void (*ah_nextverf)(\|); int (*ah_marshal)(\|); /* nextverf & serialize */ int (*ah_validate)(\|); /* validate verifier */ int (*ah_refresh)(\|); /* refresh credentials */ void (*ah_destroy)(\|); /* destroy this structure */ } *ah_ops; caddr_t ah_private; } AUTH; .Ed .Sh "The CLIENT Structure" .Bd -literal /* * Client rpc handle. * Created by individual implementations. * Client is responsible for initializing auth. */ typedef struct { AUTH *cl_auth; /* authenticator */ struct clnt_ops { enum clnt_stat (*cl_call)(); /* call remote procedure */ void (*cl_abort)(); /* abort a call */ void (*cl_geterr)(); /* get specific error code */ bool_t (*cl_freeres)(); /* frees results */ void (*cl_destroy)(); /* destroy this structure */ bool_t (*cl_control)(); /* the ioctl() of rpc */ } *cl_ops; caddr_t cl_private; /* private stuff */ char *cl_netid; /* network identifier */ char *cl_tp; /* device name */ } CLIENT; .Ed .Sh "The SVCXPRT structure" .Bd -literal enum xprt_stat { XPRT_DIED, XPRT_MOREREQS, XPRT_IDLE }; /* * Server side transport handle */ typedef struct { int xp_fd; /* file descriptor for the server handle */ u_short xp_port; /* obsolete */ const struct xp_ops { bool_t (*xp_recv)(); /* receive incoming requests */ enum xprt_stat (*xp_stat)(); /* get transport status */ bool_t (*xp_getargs)(); /* get arguments */ bool_t (*xp_reply)(); /* send reply */ bool_t (*xp_freeargs)(); /* free mem allocated for args */ void (*xp_destroy)(); /* destroy this struct */ } *xp_ops; int xp_addrlen; /* length of remote addr. Obsolete */ struct sockaddr_in xp_raddr; /* Obsolete */ const struct xp_ops2 { bool_t (*xp_control)(); /* catch-all function */ } *xp_ops2; char *xp_tp; /* transport provider device name */ char *xp_netid; /* network identifier */ struct netbuf xp_ltaddr; /* local transport address */ struct netbuf xp_rtaddr; /* remote transport address */ struct opaque_auth xp_verf; /* raw response verifier */ caddr_t xp_p1; /* private: for use by svc ops */ caddr_t xp_p2; /* private: for use by svc ops */ caddr_t xp_p3; /* private: for use by svc lib */ int xp_type /* transport type */ } SVCXPRT; .Ed .Sh "The svc_reg structure" .Bd -literal struct svc_req { rpcprog_t rq_prog; /* service program number */ rpcvers_t rq_vers; /* service protocol version */ rpcproc_t rq_proc; /* the desired procedure */ struct opaque_auth rq_cred; /* raw creds from the wire */ caddr_t rq_clntcred; /* read only cooked cred */ SVCXPRT *rq_xprt; /* associated transport */ }; .Ed .Sh "The XDR structure" .Bd -literal /* * XDR operations. * XDR_ENCODE causes the type to be encoded into the stream. * XDR_DECODE causes the type to be extracted from the stream. * XDR_FREE can be used to release the space allocated by an XDR_DECODE * request. */ enum xdr_op { XDR_ENCODE=0, XDR_DECODE=1, XDR_FREE=2 }; /* * This is the number of bytes per unit of external data. */ #define BYTES_PER_XDR_UNIT (4) #define RNDUP(x) ((((x) + BYTES_PER_XDR_UNIT - 1) / BYTES_PER_XDR_UNIT) \e * BYTES_PER_XDR_UNIT) /* * A xdrproc_t exists for each data type which is to be encoded or * decoded. The second argument to the xdrproc_t is a pointer to * an opaque pointer. The opaque pointer generally points to a * structure of the data type to be decoded. If this points to 0, * then the type routines should allocate dynamic storage of the * appropriate size and return it. * bool_t (*xdrproc_t)(XDR *, caddr_t *); */ typedef bool_t (*xdrproc_t)(); /* * The XDR handle. * Contains operation which is being applied to the stream, * an operations vector for the particular implementation */ typedef struct { enum xdr_op x_op; /* operation; fast additional param */ struct xdr_ops { bool_t (*x_getlong)(); /* get a long from underlying stream */ bool_t (*x_putlong)(); /* put a long to underlying stream */ bool_t (*x_getbytes)(); /* get bytes from underlying stream */ bool_t (*x_putbytes)(); /* put bytes to underlying stream */ u_int (*x_getpostn)(); /* returns bytes off from beginning */ bool_t (*x_setpostn)(); /* lets you reposition the stream */ long * (*x_inline)(); /* buf quick ptr to buffered data */ void (*x_destroy)(); /* free privates of this xdr_stream */ } *x_ops; caddr_t x_public; /* users' data */ caddr_t x_private; /* pointer to private data */ caddr_t x_base; /* private used for position info */ u_int x_handy; /* extra private word */ } XDR; /* * The netbuf structure. This structure is defined in on SysV * systems, but NetBSD / FreeBSD do not use XTI. * * Usually, buf will point to a struct sockaddr, and len and maxlen * will contain the length and maximum length of that socket address, * respectively. */ struct netbuf { unsigned int maxlen; unsigned int len; void *buf; }; /* * The format of the address and options arguments of the XTI t_bind call. * Only provided for compatibility, it should not be used other than * as an argument to svc_tli_create(). */ struct t_bind { struct netbuf addr; unsigned int qlen; }; .Ed .Sh "Index to Routines" The following table lists RPC routines and the manual reference pages on which they are described: .Pp .Bl -tag -width "authunix_create_default()" -compact .It Em "RPC Routine" .Em "Manual Reference Page" .Pp .It Fn auth_destroy .Xr rpc_clnt_auth 3 .It Fn authdes_create .Xr rpc_soc 3 .It Fn authnone_create .Xr rpc_clnt_auth 3 .It Fn authsys_create .Xr rpc_clnt_auth 3 .It Fn authsys_create_default .Xr rpc_clnt_auth 3 .It Fn authunix_create .Xr rpc_soc 3 .It Fn authunix_create_default .Xr rpc_soc 3 .It Fn callrpc .Xr rpc_soc 3 .It Fn clnt_broadcast .Xr rpc_soc 3 .It Fn clnt_call .Xr rpc_clnt_calls 3 .It Fn clnt_control .Xr rpc_clnt_create 3 .It Fn clnt_create .Xr rpc_clnt_create 3 .It Fn clnt_create_timed .Xr rpc_clnt_create 3 .It Fn clnt_create_vers .Xr rpc_clnt_create 3 .It Fn clnt_create_vers_timed .Xr rpc_clnt_create 3 .It Fn clnt_destroy .Xr rpc_clnt_create 3 .It Fn clnt_dg_create .Xr rpc_clnt_create 3 .It Fn clnt_freeres .Xr rpc_clnt_calls 3 .It Fn clnt_geterr .Xr rpc_clnt_calls 3 .It Fn clnt_pcreateerror .Xr rpc_clnt_create 3 .It Fn clnt_perrno .Xr rpc_clnt_calls 3 .It Fn clnt_perror .Xr rpc_clnt_calls 3 .It Fn clnt_raw_create .Xr rpc_clnt_create 3 .It Fn clnt_spcreateerror .Xr rpc_clnt_create 3 .It Fn clnt_sperrno .Xr rpc_clnt_calls 3 .It Fn clnt_sperror .Xr rpc_clnt_calls 3 .It Fn clnt_tli_create .Xr rpc_clnt_create 3 .It Fn clnt_tp_create .Xr rpc_clnt_create 3 .It Fn clnt_tp_create_timed .Xr rpc_clnt_create 3 .It Fn clnt_udpcreate .Xr rpc_soc 3 .It Fn clnt_vc_create .Xr rpc_clnt_create 3 .It Fn clntraw_create .Xr rpc_soc 3 .It Fn clnttcp_create .Xr rpc_soc 3 .It Fn clntudp_bufcreate .Xr rpc_soc 3 .It Fn get_myaddress .Xr rpc_soc 3 .It Fn pmap_getmaps .Xr rpc_soc 3 .It Fn pmap_getport .Xr rpc_soc 3 .It Fn pmap_rmtcall .Xr rpc_soc 3 .It Fn pmap_set .Xr rpc_soc 3 .It Fn pmap_unset .Xr rpc_soc 3 .It Fn registerrpc .Xr rpc_soc 3 .It Fn rpc_broadcast .Xr rpc_clnt_calls 3 .It Fn rpc_broadcast_exp .Xr rpc_clnt_calls 3 .It Fn rpc_call .Xr rpc_clnt_calls 3 .It Fn rpc_reg .Xr rpc_svc_calls 3 .It Fn svc_create .Xr rpc_svc_create 3 .It Fn svc_destroy .Xr rpc_svc_create 3 .It Fn svc_dg_create .Xr rpc_svc_create 3 .It Fn svc_dg_enablecache .Xr rpc_svc_calls 3 .It Fn svc_fd_create .Xr rpc_svc_create 3 .It Fn svc_fds .Xr rpc_soc 3 .It Fn svc_freeargs .Xr rpc_svc_reg 3 .It Fn svc_getargs .Xr rpc_svc_reg 3 .It Fn svc_getcaller .Xr rpc_soc 3 .It Fn svc_getreq .Xr rpc_soc 3 .It Fn svc_getreqset .Xr rpc_svc_calls 3 .It Fn svc_getrpccaller .Xr rpc_svc_calls 3 .It Fn svc_kerb_reg .Xr kerberos_rpc 3 .It Fn svc_raw_create .Xr rpc_svc_create 3 .It Fn svc_reg .Xr rpc_svc_calls 3 .It Fn svc_register .Xr rpc_soc 3 .It Fn svc_run .Xr rpc_svc_reg 3 .It Fn svc_sendreply .Xr rpc_svc_reg 3 .It Fn svc_tli_create .Xr rpc_svc_create 3 .It Fn svc_tp_create .Xr rpc_svc_create 3 .It Fn svc_unreg .Xr rpc_svc_calls 3 .It Fn svc_unregister .Xr rpc_soc 3 .It Fn svc_vc_create .Xr rpc_svc_create 3 .It Fn svcerr_auth .Xr rpc_svc_err 3 .It Fn svcerr_decode .Xr rpc_svc_err 3 .It Fn svcerr_noproc .Xr rpc_svc_err 3 .It Fn svcerr_noprog .Xr rpc_svc_err 3 .It Fn svcerr_progvers .Xr rpc_svc_err 3 .It Fn svcerr_systemerr .Xr rpc_svc_err 3 .It Fn svcerr_weakauth .Xr rpc_svc_err 3 .It Fn svcfd_create .Xr rpc_soc 3 .It Fn svcraw_create .Xr rpc_soc 3 .It Fn svctcp_create .Xr rpc_soc 3 .It Fn svcudp_bufcreate .Xr rpc_soc 3 .It Fn svcudp_create .Xr rpc_soc 3 .It Fn xdr_accepted_reply .Xr rpc_xdr 3 .It Fn xdr_authsys_parms .Xr rpc_xdr 3 .It Fn xdr_authunix_parms .Xr rpc_soc 3 .It Fn xdr_callhdr .Xr rpc_xdr 3 .It Fn xdr_callmsg .Xr rpc_xdr 3 .It Fn xdr_opaque_auth .Xr rpc_xdr 3 .It Fn xdr_rejected_reply .Xr rpc_xdr 3 .It Fn xdr_replymsg .Xr rpc_xdr 3 .It Fn xprt_register .Xr rpc_svc_calls 3 .It Fn xprt_unregister .Xr rpc_svc_calls 3 .El .Sh FILES .Bl -tag -width /etc/netconfig .It Pa /etc/netconfig .El .Sh SEE ALSO .Xr getnetconfig 3 , .Xr getnetpath 3 , -.Xr rpcbind 3 , .Xr rpc_clnt_auth 3 , .Xr rpc_clnt_calls 3 , .Xr rpc_clnt_create 3 , .Xr rpc_svc_calls 3 , .Xr rpc_svc_create 3 , .Xr rpc_svc_err 3 , .Xr rpc_svc_reg 3 , .Xr rpc_xdr 3 , +.Xr rpcbind 3 , .Xr xdr 3 , .Xr netconfig 5 Index: head/lib/libc/rpc/rpc_svc_reg.3 =================================================================== --- head/lib/libc/rpc/rpc_svc_reg.3 (revision 276293) +++ head/lib/libc/rpc/rpc_svc_reg.3 (revision 276294) @@ -1,183 +1,183 @@ .\" @(#)rpc_svc_reg.3n 1.32 93/08/31 SMI; from SVr4 .\" Copyright 1989 AT&T .\" @(#)rpc_svc_call 1.6 89/07/20 SMI; .\" Copyright (c) 1988 Sun Microsystems, Inc. - All Rights Reserved. .\" $NetBSD: rpc_svc_reg.3,v 1.1 2000/06/02 23:11:14 fvdl Exp $ .\" $FreeBSD$ .Dd May 3, 1993 .Dt RPC_SVC_REG 3 .Os .Sh NAME .Nm rpc_svc_reg , .Nm rpc_reg , .Nm svc_reg , .Nm svc_unreg , .Nm svc_auth_reg , .Nm xprt_register , .Nm xprt_unregister .Nd library routines for registering servers .Sh LIBRARY .Lb libc .Sh SYNOPSIS .In rpc/rpc.h .Ft int .Fn rpc_reg "rpcprog_t prognum" "rpcvers_t versnum" "rpcproc_t procnum" "char *(*procname)()" "xdrproc_t inproc" "xdrproc_t outproc" "char *nettype" .Ft bool_t .Fn svc_reg "SVCXPRT *xprt" "const rpcprog_t prognum" "const rpcvers_t versnum" "void (*dispatch)(struct svc_req *, SVCXPRT *)" "const struct netconfig *netconf" .Ft void .Fn svc_unreg "const rpcprog_t prognum" "const rpcvers_t versnum" .Ft int .Fn svc_auth_reg "int cred_flavor" "enum auth_stat (*handler)(struct svc_req *, struct rpc_msg *)" .Ft void .Fn xprt_register "SVCXPRT *xprt" .Ft void .Fn xprt_unregister "SVCXPRT *xprt" .Sh DESCRIPTION These routines are a part of the RPC library which allows the RPC servers to register themselves with rpcbind (see .Xr rpcbind 8 ) , and associate the given program and version number with the dispatch function. When the RPC server receives a RPC request, the library invokes the dispatch routine with the appropriate arguments. .Sh Routines See .Xr rpc 3 for the definition of the .Vt SVCXPRT data structure. .Bl -tag -width XXXXX .It Fn rpc_reg Register program .Fa prognum , procedure .Fa procname , and version .Fa versnum with the RPC service package. If a request arrives for program .Fa prognum , version .Fa versnum , and procedure .Fa procnum , .Fa procname is called with a pointer to its argument(s); .Fa procname should return a pointer to its static result(s); .Fa inproc is the XDR function used to decode the arguments while .Fa outproc is the XDR function used to encode the results. Procedures are registered on all available transports of the class .Fa nettype . See .Xr rpc 3 . This routine returns 0 if the registration succeeded, \-1 otherwise. .It Fn svc_reg Associates .Fa prognum and .Fa versnum with the service dispatch procedure, .Fa dispatch . If .Fa netconf is .Dv NULL , the service is not registered with the .Xr rpcbind 8 service. If .Fa netconf is non-zero, then a mapping of the triple .Bq Fa prognum , versnum , netconf->nc_netid to .Fa xprt->xp_ltaddr is established with the local rpcbind service. .Pp The .Fn svc_reg routine returns 1 if it succeeds, and 0 otherwise. .It Fn svc_unreg Remove from the rpcbind service, all mappings of the triple .Bq Fa prognum , versnum , No all-transports to network address and all mappings within the RPC service package of the double .Bq Fa prognum , versnum to dispatch routines. .It Fn svc_auth_reg Registers the service authentication routine .Fa handler with the dispatch mechanism so that it can be invoked to authenticate RPC requests received with authentication type .Fa cred_flavor . This interface allows developers to add new authentication types to their RPC applications without needing to modify the libraries. Service implementors usually do not need this routine. .Pp Typical service application would call .Fn svc_auth_reg after registering the service and prior to calling .Fn svc_run . When needed to process an RPC credential of type .Fa cred_flavor , the .Fa handler procedure will be called with two arguments, .Fa "struct svc_req *rqst" and .Fa "struct rpc_msg *msg" , and is expected to return a valid .Vt "enum auth_stat" value. There is no provision to change or delete an authentication handler once registered. .Pp The .Fn svc_auth_reg routine returns 0 if the registration is successful, 1 if .Fa cred_flavor already has an authentication handler registered for it, and \-1 otherwise. .It Fn xprt_register After RPC service transport handle .Fa xprt is created, it is registered with the RPC service package. This routine modifies the global variable .Va svc_fdset (see .Xr rpc_svc_calls 3 ) . Service implementors usually do not need this routine. .It Fn xprt_unregister Before an RPC service transport handle .Fa xprt is destroyed, it unregisters itself with the RPC service package. This routine modifies the global variable .Va svc_fdset (see .Xr rpc_svc_calls 3 ) . Service implementors usually do not need this routine. .El .Sh SEE ALSO .Xr select 2 , .Xr rpc 3 , -.Xr rpcbind 3 , .Xr rpc_svc_calls 3 , .Xr rpc_svc_create 3 , .Xr rpc_svc_err 3 , +.Xr rpcbind 3 , .Xr rpcbind 8 Index: head/lib/libpam/modules/pam_guest/pam_guest.8 =================================================================== --- head/lib/libpam/modules/pam_guest/pam_guest.8 (revision 276293) +++ head/lib/libpam/modules/pam_guest/pam_guest.8 (revision 276294) @@ -1,98 +1,98 @@ .\" Copyright (c) 2003 Networks Associates Technology, Inc. .\" All rights reserved. .\" .\" Portions of this software were developed for the FreeBSD Project by .\" ThinkSec AS and NAI Labs, the Security Research Division of Network .\" Associates, Inc. under DARPA/SPAWAR contract N66001-01-C-8035 .\" ("CBOSS"), as part of the DARPA CHATS research program. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" 3. The name of the author may not be used to endorse or promote .\" products derived from this software without specific prior written .\" permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" .Dd May 26, 2003 .Dt PAM_GUEST 8 .Os .Sh NAME .Nm pam_guest .Nd Guest PAM module .Sh SYNOPSIS .Op Ar service-name .Ar module-type .Ar control-flag .Pa pam_guest .Op Ar arguments .Sh DESCRIPTION The guest service module for PAM allows guest logins. If successful, the .Nm module sets the PAM environment variable .Ev GUEST to the login name. The application can check this variable using .Xr pam_getenv 3 to differentiate guest logins from normal logins. .Pp The following options may be passed to the .Nm module: .Bl -tag -width ".Cm pass_as_ruser" .It Cm guests Ns = Ns Ar list Comma-separated list of guest account names. The default is .Dq Li guest . A typical value for .Xr ftpd 8 would be .Dq Li anonymous,ftp . .It Cm nopass Omits the password prompt if the target account is on the list of guest accounts. .It Cm pass_as_ruser The password typed in by the user is exported as the .Dv PAM_RUSER item. This is useful for applications like .Xr ftpd 8 where guest users are encouraged to use their email address as password. .It Cm pass_is_user Requires the guest user to type in the guest account name as password. .El .Sh SEE ALSO -.Xr pam_getenv 3 , .Xr pam_get_item 3 , +.Xr pam_getenv 3 , .Xr pam.conf 5 , .Xr pam 8 .Sh AUTHORS The .Nm module and this manual page were developed for the .Fx Project by ThinkSec AS and NAI Labs, the Security Research Division of Network Associates, Inc.\& under DARPA/SPAWAR contract N66001-01-C-8035 .Pq Dq CBOSS , as part of the DARPA CHATS research program. Index: head/lib/librtld_db/librtld_db.3 =================================================================== --- head/lib/librtld_db/librtld_db.3 (revision 276293) +++ head/lib/librtld_db/librtld_db.3 (revision 276294) @@ -1,191 +1,191 @@ .\"- .\" Copyright (c) 2010 The FreeBSD Foundation .\" All rights reserved. .\" .\" This software was developed by Rui Paulo under sponsorship from .\" the FreeBSD Foundation. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" .Dd June 10, 2010 .Dt LIBRTLD_DB 3 .Os .Sh NAME .Nm librtld_db .Nd library for run-time linker debugging .Sh LIBRARY .Lb librtld_db .Sh SYNOPSIS .In rtld_db.h .Ft void .Fo rd_delete .Fa "rd_agent_t *rdap" .Fc .Ft char * .Fo rd_errstr .Fa "rd_err_e rderr" .Fc .Ft rd_err_e .Fo rd_event_addr .Fa "rd_agent_t *rdap, rd_event_e event, rd_notify_t *notify" .Fc .Ft rd_err_e .Fo rd_event_enable .Fa "rd_agent_t *rdap, int onoff" .Fc .Ft rd_err_e .Fo rd_event_getmsg .Fa "rd_agent_t *rdap, rd_event_msg_t *msg" .Fc .Ft rd_err_e .Fo rd_init .Fa "int version" .Fc .Ft typedef int .Fo rl_iter_f .Fa "const rd_loadobj_t *, void *" .Fc .Ft rd_err_e .Fo rd_loadobj_iter .Fa "rd_agent_t *rdap, rl_iter_f *cb, void *clnt_data" .Fc .Ft void .Fo rd_log .Fa "const int onoff" .Fc .Ft rd_agent_t * .Fo rd_new .Fa "struct proc_handle *php" .Fc .Ft rd_err_e .Fo rd_objpad_enable .Fa "rd_agent_t *rdap, size_t padsize" .Fc .Ft rd_err_e .Fo rd_plt_resolution .Fa "rd_agent_t *rdap, uintptr_t pc, struct proc *proc" .Fa "uintptr_t plt_base, rd_plt_info_t *rpi" .Fc .Ft rd_err_e .Fo rd_reset .Fa "rd_agent_t *rdap" .Fc .Sh DESCRIPTION The .Nm librtld_db library provides a debugging interface to the run-time linker (rtld). This library must be used along with .Xr libproc 3 . .Pp Most library functions take a .Ft rd_agent_t argument. This argument is an opaque structure containing information associated with the current status of the agent. .Pp Before you start using .Nm you should call .Fn rd_init with the .Ft RD_VERSION argument. This initializes the library to the correct version your program was compiled with and provides proper ABI stability. .Pp What follows is a description of what each function. .Pp .Fn rd_new creates a new .Nm agent. The .Ft php argument should be the .Ft proc_handle you received from .Xr libproc 3 . .Pp .Fn rd_reset resets your previously created agent. .Pp .Fn rd_delete deallocates the resources associated with the agent. .Pp .Fn rd_errstr returns an error string describing the error present in .Ft rderr . .Pp .Fn rd_event_enable enables reporting of events. This function always returns RD_OK. .Pp .Fn rd_event_addr returns the event address corresponding to the .Ft event parameter. At the moment we only report events of type RD_NOTIFY_BPT. .Pp .Fn rd_event_getmsg returns the message associated with the latest event. At the moment only RD_POSTINIT events are supported. .Pp .Fn rd_loadobj_iter allows you to iterate over the program's loaded objects. .Ft cb is a callback of type .Fn rl_iter_f . .Sh RETURN VALUES Most functions return an .Ft rd_err_e type error. The error codes are described in the header file for this library. You can get the error string using .Fn rd_errstr . .Sh SEE ALSO .Xr ld 1 , .Xr ld-elf.so.1 1 , .Xr ld.so 1 , -.Xr libproc 3 , -.Xr rtld 1 +.Xr rtld 1 , +.Xr libproc 3 .Sh HISTORY The .Nm librtld_db library first appeared in .Fx 9.0 and was modeled after the same library present in the Solaris operating system. .Sh AUTHORS The .Nm librtld_db library and this manual page were written by .An Rui Paulo Aq Mt rpaulo@FreeBSD.org under sponsorship from the FreeBSD Foundation. .Sh CAVEATS The functions .Fn rd_event_enable , .Fn rd_log , .Fn rd_objpad_enable and .Fn rd_plt_resolution are not yet implemented. Index: head/lib/libusb/libusb20.3 =================================================================== --- head/lib/libusb/libusb20.3 (revision 276293) +++ head/lib/libusb/libusb20.3 (revision 276294) @@ -1,1067 +1,1067 @@ .\" .\" Copyright (c) 2008 Hans Petter Selasky .\" .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" .Dd May 3, 2013 .Dt LIBUSB20 3 .Os .Sh NAME .Nm libusb20 . .Nd "USB access library" . . .Sh LIBRARY . . USB access library (libusb -lusb) . . . .Sh SYNOPSIS .In libusb20.h .Ft int .Fn libusb20_tr_close "struct libusb20_transfer *xfer" .Ft int .Fn libusb20_tr_open "struct libusb20_transfer *xfer" "uint32_t max_buf_size" "uint32_t max_frame_count" "uint8_t ep_no" .Fn libusb20_tr_open_stream "struct libusb20_transfer *xfer" "uint32_t max_buf_size" "uint32_t max_frame_count" "uint8_t ep_no" "uint16_t stream_id" .Ft struct libusb20_transfer* .Fn libusb20_tr_get_pointer "struct libusb20_device *pdev" "uint16_t tr_index" .Ft uint16_t .Fn libusb20_tr_get_time_complete "struct libusb20_transfer *xfer" .Ft uint32_t .Fn libusb20_tr_get_actual_frames "struct libusb20_transfer *xfer" .Ft uint32_t .Fn libusb20_tr_get_actual_length "struct libusb20_transfer *xfer" .Ft uint32_t .Fn libusb20_tr_get_max_frames "struct libusb20_transfer *xfer" .Ft uint32_t .Fn libusb20_tr_get_max_packet_length "struct libusb20_transfer *xfer" .Ft uint32_t .Fn libusb20_tr_get_max_total_length "struct libusb20_transfer *xfer" .Ft uint8_t .Fn libusb20_tr_get_status "struct libusb20_transfer *xfer" .Ft uint8_t .Fn libusb20_tr_pending "struct libusb20_transfer *xfer" .Ft void .Fn libusb20_tr_callback_wrapper "struct libusb20_transfer *xfer" .Ft void .Fn libusb20_tr_clear_stall_sync "struct libusb20_transfer *xfer" .Ft void .Fn libusb20_tr_drain "struct libusb20_transfer *xfer" .Ft void .Fn libusb20_tr_set_buffer "struct libusb20_transfer *xfer" "void *buffer" "uint16_t fr_index" .Ft void .Fn libusb20_tr_set_callback "struct libusb20_transfer *xfer" "libusb20_tr_callback_t *cb" .Ft void .Fn libusb20_tr_set_flags "struct libusb20_transfer *xfer" "uint8_t flags" .Ft uint32_t .Fn libusb20_tr_get_length "struct libusb20_transfer *xfer" "uint16_t fr_index" .Ft void .Fn libusb20_tr_set_length "struct libusb20_transfer *xfer" "uint32_t length" "uint16_t fr_index" .Ft void .Fn libusb20_tr_set_priv_sc0 "struct libusb20_transfer *xfer" "void *sc0" .Ft void .Fn libusb20_tr_set_priv_sc1 "struct libusb20_transfer *xfer" "void *sc1" .Ft void .Fn libusb20_tr_set_timeout "struct libusb20_transfer *xfer" "uint32_t timeout" .Ft void .Fn libusb20_tr_set_total_frames "struct libusb20_transfer *xfer" "uint32_t nframes" .Ft void .Fn libusb20_tr_setup_bulk "struct libusb20_transfer *xfer" "void *pbuf" "uint32_t length" "uint32_t timeout" .Ft void .Fn libusb20_tr_setup_control "struct libusb20_transfer *xfer" "void *psetup" "void *pbuf" "uint32_t timeout" .Ft void .Fn libusb20_tr_setup_intr "struct libusb20_transfer *xfer" "void *pbuf" "uint32_t length" "uint32_t timeout" .Ft void .Fn libusb20_tr_setup_isoc "struct libusb20_transfer *xfer" "void *pbuf" "uint32_t length" "uint61_t fr_index" .Ft uint8_t .Fn libusb20_tr_bulk_intr_sync "struct libusb20_transfer *xfer" "void *pbuf" "uint32_t length" "uint32_t *pactlen" "uint32_t timeout" .Ft void .Fn libusb20_tr_start "struct libusb20_transfer *xfer" .Ft void .Fn libusb20_tr_stop "struct libusb20_transfer *xfer" .Ft void .Fn libusb20_tr_submit "struct libusb20_transfer *xfer" .Ft void * .Fn libusb20_tr_get_priv_sc0 "struct libusb20_transfer *xfer" .Ft void * .Fn libusb20_tr_get_priv_sc1 "struct libusb20_transfer *xfer" .Ft const char * .Fn libusb20_dev_get_backend_name "struct libusb20_device *" .Ft int .Fn libusb20_dev_get_port_path "struct libusb20_device *pdev" "uint8_t *buf" "uint8_t bufsize" .Ft int .Fn libusb20_dev_get_info "struct libusb20_device *pdev" "struct usb_device_info *pinfo" .Ft int .Fn libusb20_dev_get_iface_desc "struct libusb20_device *pdev" "uint8_t iface_index" "char *buf" "uint8_t len" .Ft const char * .Fn libusb20_dev_get_desc "struct libusb20_device *pdev" .Ft int .Fn libusb20_dev_close "struct libusb20_device *pdev" .Ft int .Fn libusb20_dev_detach_kernel_driver "struct libusb20_device *pdev" "uint8_t iface_index" .Ft int .Fn libusb20_dev_set_config_index "struct libusb20_device *pdev" "uint8_t configIndex" .Ft int .Fn libusb20_dev_get_debug "struct libusb20_device *pdev" .Ft int .Fn libusb20_dev_get_fd "struct libusb20_device *pdev" .Ft int .Fn libusb20_dev_kernel_driver_active "struct libusb20_device *pdev" "uint8_t iface_index" .Ft int .Fn libusb20_dev_open "struct libusb20_device *pdev" "uint16_t transfer_max" .Ft int .Fn libusb20_dev_process "struct libusb20_device *pdev" .Ft int .Fn libusb20_dev_request_sync "struct libusb20_device *pdev" "struct LIBUSB20_CONTROL_SETUP_DECODED *setup" "void *data" "uint16_t *pactlen" "uint32_t timeout" "uint8_t flags" .Ft int .Fn libusb20_dev_req_string_sync "struct libusb20_device *pdev" "uint8_t index" "uint16_t langid" "void *ptr" "uint16_t len" .Ft int .Fn libusb20_dev_req_string_simple_sync "struct libusb20_device *pdev" "uint8_t index" "void *ptr" "uint16_t len" .Ft int .Fn libusb20_dev_reset "struct libusb20_device *pdev" .Ft int .Fn libusb20_dev_check_connected "struct libusb20_device *pdev" .Ft int .Fn libusb20_dev_set_power_mode "struct libusb20_device *pdev" "uint8_t power_mode" .Ft uint8_t .Fn libusb20_dev_get_power_mode "struct libusb20_device *pdev" .Ft uint16_t .Fn libusb20_dev_get_power_usage "struct libusb20_device *pdev" .Ft int .Fn libusb20_dev_set_alt_index "struct libusb20_device *pdev" "uint8_t iface_index" "uint8_t alt_index" .Ft struct LIBUSB20_DEVICE_DESC_DECODED * .Fn libusb20_dev_get_device_desc "struct libusb20_device *pdev" .Ft struct libusb20_config * .Fn libusb20_dev_alloc_config "struct libusb20_device *pdev" "uint8_t config_index" .Ft struct libusb20_device * .Fn libusb20_dev_alloc "void" .Ft uint8_t .Fn libusb20_dev_get_address "struct libusb20_device *pdev" .Ft uint8_t .Fn libusb20_dev_get_parent_address "struct libusb20_device *pdev" .Ft uint8_t .Fn libusb20_dev_get_parent_port "struct libusb20_device *pdev" .Ft uint8_t .Fn libusb20_dev_get_bus_number "struct libusb20_device *pdev" .Ft uint8_t .Fn libusb20_dev_get_mode "struct libusb20_device *pdev" .Ft uint8_t .Fn libusb20_dev_get_speed "struct libusb20_device *pdev" .Ft uint8_t .Fn libusb20_dev_get_config_index "struct libusb20_device *pdev" .Ft void .Fn libusb20_dev_free "struct libusb20_device *pdev" .Ft void .Fn libusb20_dev_set_debug "struct libusb20_device *pdev" "int debug" .Ft void .Fn libusb20_dev_wait_process "struct libusb20_device *pdev" "int timeout" .Ft int .Fn libusb20_be_get_template "struct libusb20_backend *pbe" "int *ptemp" .Ft int .Fn libusb20_be_set_template "struct libusb20_backend *pbe" "int temp" .Ft int .Fn libusb20_be_get_dev_quirk "struct libusb20_backend *pber" "uint16_t index" "struct libusb20_quirk *pq" .Ft int .Fn libusb20_be_get_quirk_name "struct libusb20_backend *pbe" "uint16_t index" "struct libusb20_quirk *pq" .Ft int .Fn libusb20_be_add_dev_quirk "struct libusb20_backend *pbe" "struct libusb20_quirk *pq" .Ft int .Fn libusb20_be_remove_dev_quirk "struct libusb20_backend *pbe" "struct libusb20_quirk *pq" .Ft struct libusb20_backend * .Fn libusb20_be_alloc_default "void" .Ft struct libusb20_backend * .Fn libusb20_be_alloc_freebsd "void" .Ft struct libusb20_backend * .Fn libusb20_be_alloc_linux "void" .Ft struct libusb20_device * .Fn libusb20_be_device_foreach "struct libusb20_backend *pbe" "struct libusb20_device *pdev" .Ft void .Fn libusb20_be_dequeue_device "struct libusb20_backend *pbe" "struct libusb20_device *pdev" .Ft void .Fn libusb20_be_enqueue_device "struct libusb20_backend *pbe" "struct libusb20_device *pdev" .Ft void .Fn libusb20_be_free "struct libusb20_backend *pbe" .Ft uint8_t .Fn libusb20_me_get_1 "const struct libusb20_me_struct *me" "uint16_t off" .Ft uint16_t .Fn libusb20_me_get_2 "const struct libusb20_me_struct *me" "uint16_t off" .Ft uint16_t .Fn libusb20_me_encode "void *pdata" "uint16_t len" "const void *pdecoded" .Ft uint16_t .Fn libusb20_me_decode "const void *pdata" "uint16_t len" "void *pdecoded" .Ft "const uint8_t *" .Fn libusb20_desc_foreach "const struct libusb20_me_struct *me" "const uint8_t *pdesc" .Ft "const char *" .Fn libusb20_strerror "int code" .Ft "const char *" .Fn libusb20_error_name "int code" . . .Sh DESCRIPTION . The .Nm library implements functions to be able to easily access and control USB through the USB file system interface. The .Nm interfaces are specific to the .Fx usb stack and are not available on other operating systems, portable applications should consider using .Xr libusb 3 . . . .Sh USB TRANSFER OPERATIONS . . .Fn libusb20_tr_close will release all kernel resources associated with an USB .Fa xfer . . This function returns zero upon success. . Non-zero return values indicate a LIBUSB20_ERROR value. . .Pp . .Fn libusb20_tr_open will allocate kernel buffer resources according to .Fa max_buf_size and .Fa max_frame_count associated with an USB .Fa pxfer and bind the transfer to the specified .Fa ep_no . .Fa max_buf_size is the minimum buffer size which the data transport layer has to support. If .Fa max_buf_size is zero, the .Nm library will use wMaxPacketSize to compute the buffer size. This can be useful for isochronous transfers. The actual buffer size can be greater than .Fa max_buf_size and is returned by .Fn libusb20_tr_get_max_total_length . . If .Fa max_frame_count is OR'ed with LIBUSB20_MAX_FRAME_PRE_SCALE the remaining part of the argument is converted from milliseconds into the actual number of frames rounded up, when this function returns. This flag is only valid for ISOCHRONOUS transfers and has no effect for other transfer types. The actual number of frames setup is found by calling .Fn libusb20_tr_get_max_frames . . This function returns zero upon success. . Non-zero return values indicate a LIBUSB20_ERROR value. . .Pp . .Fn libusb20_tr_open_stream is identical to .Fn libusb20_tr_open except that a stream ID can be specified for BULK endpoints having such a feature. .Fn libusb20_tr_open can be used to open stream ID zero. . .Pp . .Fn libusb20_tr_get_pointer will return a pointer to the allocated USB transfer according to the .Fa pdev and .Fa tr_index arguments. . This function returns NULL in case of failure. . .Pp . .Fn libusb20_tr_get_time_complete will return the completion time of an USB transfer in millisecond units. This function is most useful for isochronous USB transfers when doing echo cancelling. . .Pp . .Fn libusb20_tr_get_actual_frames will return the actual number of USB frames after an USB transfer completed. A value of zero means that no data was transferred. . .Pp . .Fn libusb20_tr_get_actual_length will return the sum of the actual length for all transferred USB frames for the given USB transfer. . .Pp . .Fn libusb20_tr_get_max_frames will return the maximum number of USB frames that were allocated when an USB transfer was setup for the given USB transfer. . .Pp . .Fn libusb20_tr_get_max_packet_length will return the maximum packet length in bytes associated with the given USB transfer. . The packet length can be used round up buffer sizes so that short USB packets are avoided for proxy buffers. . . .Pp . .Fn libusb20_tr_get_max_total_length will return the maximum value for the data length sum of all USB frames associated with an USB transfer. In case of control transfers the value returned does not include the length of the SETUP packet, 8 bytes, which is part of frame zero. The returned value of this function is always aligned to the maximum packet size, wMaxPacketSize, of the endpoint which the USB transfer is bound to. . .Pp . .Fn libusb20_tr_get_status will return the status of an USB transfer. . Status values are defined by a set of LIBUSB20_TRANSFER_XXX enums. . .Pp . .Fn libusb20_tr_pending will return non-zero if the given USB transfer is pending for completion. . Else this function returns zero. . .Pp . .Fn libusb20_tr_callback_wrapper This is an internal function used to wrap asynchronous USB callbacks. . .Pp . .Fn libusb20_tr_clear_stall_sync This is an internal function used to synchronously clear the stall on the given USB transfer. . Please see the USB specification for more information on stall clearing. . If the given USB transfer is pending when this function is called, the USB transfer will complete with an error after that this function has been called. . .Pp . .Fn libusb20_tr_drain will stop the given USB transfer and will not return until the USB transfer has been stopped in hardware. . .Pp . .Fn libusb20_tr_set_buffer is used to set the .Fa buffer pointer for the given USB transfer and .Fa fr_index . . Typically the frame index is zero. . . .Pp . .Fn libusb20_tr_set_callback is used to set the USB callback for asynchronous USB transfers. . The callback type is defined by libusb20_tr_callback_t. . .Pp . .Fn libusb20_tr_set_flags is used to set various USB flags for the given USB transfer. .Bl -tag -width "LIBUSB20_TRANSFER_SINGLE_SHORT_NOT_OK" .It LIBUSB20_TRANSFER_SINGLE_SHORT_NOT_OK Report a short frame as error. .It LIBUSB20_TRANSFER_MULTI_SHORT_NOT_OK Multiple short frames are not allowed. .It LIBUSB20_TRANSFER_FORCE_SHORT All transmitted frames are short terminated. .It LIBUSB20_TRANSFER_DO_CLEAR_STALL Will do a clear-stall before starting the transfer. .El . .Pp . .Fn libusb20_tr_get_length returns the length of the given USB frame by index. After an USB transfer is complete the USB frame length will get updated to the actual transferred length. . .Pp . .Fn libusb20_tr_set_length sets the length of the given USB frame by index. . .Pp . .Fn libusb20_tr_set_priv_sc0 sets private driver pointer number zero. . .Pp . .Fn libusb20_tr_set_priv_sc1 sets private driver pointer number one. . .Pp . .Fn libusb20_tr_set_timeout sets the timeout for the given USB transfer. . A timeout value of zero means no timeout. . The timeout is given in milliseconds. . .Pp . .Fn libusb20_tr_set_total_frames sets the total number of frames that should be executed when the USB transfer is submitted. . The total number of USB frames must be less than the maximum number of USB frames associated with the given USB transfer. . .Pp . .Fn libusb20_tr_setup_bulk is a helper function for setting up a single frame USB BULK transfer. . .Pp . .Fn libusb20_tr_setup_control is a helper function for setting up a single or dual frame USB CONTROL transfer depending on the control transfer length. . .Pp . .Fn libusb20_tr_setup_intr is a helper function for setting up a single frame USB INTERRUPT transfer. . .Pp . .Fn libusb20_tr_setup_isoc is a helper function for setting up a multi frame USB ISOCHRONOUS transfer. . .Pp . .Fn libusb20_tr_bulk_intr_sync will perform a synchronous BULK or INTERRUPT transfer having length given by the .Fa length argument and buffer pointer given by the .Fa pbuf argument on the USB transfer given by the .Fa xfer argument. . If the .Fa pactlen argument is non-NULL the actual transfer length will be stored at the given pointer destination. . If the .Fa timeout argument is non-zero the transfer will timeout after the given value in milliseconds. . This function does not change the transfer flags, like short packet not ok. . This function returns zero on success else a LIBUSB20_TRANSFER_XXX value is returned. . .Pp . .Fn libusb20_tr_start will get the USB transfer started, if not already started. . This function will not get the transfer queued in hardware. . This function is non-blocking. . .Pp . .Fn libusb20_tr_stop will get the USB transfer stopped, if not already stopped. . This function is non-blocking, which means that the actual stop can happen after the return of this function. . .Pp . .Fn libusb20_tr_submit will get the USB transfer queued in hardware. . . .Pp . .Fn libusb20_tr_get_priv_sc0 returns private driver pointer number zero associated with an USB transfer. . . .Pp . .Fn libusb20_tr_get_priv_sc1 returns private driver pointer number one associated with an USB transfer. . . .Sh USB DEVICE OPERATIONS . . .Fn libusb20_dev_get_backend_name returns a zero terminated string describing the backend used. . .Pp . .Fn libusb20_dev_get_port_path retrieves the list of USB port numbers which the datastream for a given USB device follows. The first port number is the Root HUB port number. Then children port numbers follow. The Root HUB device itself has a port path length of zero. Valid port numbers start at one and range until and including 255. Typically there should not be more than 16 levels, due to electrical and protocol limitations. This functions returns the number of actual port levels upon success else a LIBUSB20_ERROR value is returned which are always negative. If the actual number of port levels is greater than the maximum specified, a LIBUSB20_ERROR value is returned. . .Pp . .Fn libusb20_dev_get_info retrieves the BSD specific usb_device_info structure into the memory location given by .Fa pinfo . The USB device given by .Fa pdev must be opened before this function will succeed. This function returns zero on success else a LIBUSB20_ERROR value is returned. . .Pp . .Fn libusb20_dev_get_iface_desc retrieves the kernel interface description for the given USB .Fa iface_index . The format of the USB interface description is: "drivername: " The description string is always zero terminated. A zero length string is written in case no driver is attached to the given interface. The USB device given by .Fa pdev must be opened before this function will succeed. This function returns zero on success else a LIBUSB20_ERROR value is returned. . .Pp . .Fn libusb20_dev_get_desc returns a zero terminated string describing the given USB device. The format of the string is: "drivername: " . .Pp . .Fn libusb20_dev_close will close the given USB device. . This function returns zero on success else a LIBUSB20_ERROR value is returned. . .Pp . .Fn libusb20_dev_detach_kernel_driver will try to detach the kernel driver for the USB interface given by .Fa iface_index . . This function returns zero on success else a LIBUSB20_ERROR value is returned. . .Pp . .Fn libusb20_dev_set_config_index will try to set the configuration index on an USB device. . The first configuration index is zero. . The un-configure index is 255. . This function returns zero on success else a LIBUSB20_ERROR value is returned. . .Pp . .Fn libusb20_dev_get_debug returns the debug level of an USB device. . .Pp . .Fn libusb20_dev_get_fd returns the file descriptor of the given USB device. . A negative value is returned when no file descriptor is present. . The file descriptor can be used for polling purposes. . .Pp . .Fn libusb20_dev_kernel_driver_active returns zero if a kernel driver is active on the given USB interface. . Else a LIBUSB20_ERROR value is returned. . .Pp . .Fn libusb20_dev_open opens an USB device so that setting up USB transfers becomes possible. . The number of USB transfers can be zero which means only control transfers are allowed. . This function returns zero on success else a LIBUSB20_ERROR value is returned. . A return value of LIBUSB20_ERROR_BUSY means that the device is already opened. . .Pp . .Fn libusb20_dev_process is called to sync kernel USB transfers with userland USB transfers. . This function returns zero on success else a LIBUSB20_ERROR value is returned typically indicating that the given USB device has been detached. . .Pp . .Fn libusb20_dev_request_sync will perform a synchronous control request on the given USB device. . Before this call will succeed the USB device must be opened. . .Fa setup is a pointer to a decoded and host endian SETUP packet. .Fa data is a pointer to a data transfer buffer associated with the control transaction. This argument can be NULL. .Fa pactlen is a pointer to a variable that will hold the actual transfer length after the control transaction is complete. .Fa timeout is the transaction timeout given in milliseconds. A timeout of zero means no timeout. .Fa flags is used to specify transaction flags, for example LIBUSB20_TRANSFER_SINGLE_SHORT_NOT_OK. . This function returns zero on success else a LIBUSB20_ERROR value is returned. . .Pp . .Fn libusb20_dev_req_string_sync will synchronously request an USB string by language ID and string index into the given buffer limited by a maximum length. . This function returns zero on success else a LIBUSB20_ERROR value is returned. . .Pp . .Fn libusb20_dev_req_string_simple_sync will synchronously request an USB string using the default language ID and convert the string into ASCII before storing the string into the given buffer limited by a maximum length which includes the terminating zero. . This function returns zero on success else a LIBUSB20_ERROR value is returned. . . .Pp . .Fn libusb20_dev_reset will try to BUS reset the given USB device and restore the last set USB configuration. . This function returns zero on success else a LIBUSB20_ERROR value is returned. . . .Pp . .Fn libusb20_dev_check_connected will check if an opened USB device is still connected. . This function returns zero if the device is still connected else a LIBUSB20_ERROR value is returned. . . .Pp . .Fn libusb20_dev_set_power_mode sets the power mode of the USB device. . Valid power modes: .Bl -tag -width "LIBUSB20_POWER_OFF" .It LIBUSB20_POWER_OFF .It LIBUSB20_POWER_ON .It LIBUSB20_POWER_SAVE .It LIBUSB20_POWER_SUSPEND .It LIBUSB20_POWER_RESUME .El .Pp . This function returns zero on success else a LIBUSB20_ERROR value is returned. . .Pp . .Fn libusb20_dev_get_power_mode returns the currently selected power mode for the given USB device. . .Pp . .Fn libusb20_dev_get_power_usage returns the reported power usage in milliamps for the given USB device. A power usage of zero typically means that the device is self powered. . .Pp . .Fn libusb20_dev_set_alt_index will try to set the given alternate index for the given USB interface index. . This function returns zero on success else a LIBUSB20_ERROR value is returned. . .Pp . .Fn libusb20_dev_get_device_desc returns a pointer to the decoded and host endian version of the device descriptor. . The USB device need not be opened when calling this function. . .Pp . .Fn libusb20_dev_alloc_config will read out and decode the USB config descriptor for the given USB device and config index. This function returns a pointer to the decoded configuration which must eventually be passed to free(). NULL is returned in case of failure. . .Pp . .Fn libusb20_dev_alloc is an internal function to allocate a new USB device. . .Pp . .Fn libusb20_dev_get_address returns the internal and not necessarily the real hardware address of the given USB device. Valid addresses start at one. . .Pp . .Fn libusb20_dev_get_parent_address returns the internal and not necessarily the real hardware address of the given parent USB HUB device. This value is zero for the root HUB which usually has a device address equal to one. Valid addresses start at one. . .Pp . .Fn libusb20_dev_get_parent_port returns the port number on the parent USB HUB device. This value is zero for the root HUB which usually has a device address equal to one. Valid port numbers start at one. . .Pp . .Fn libusb20_dev_get_bus_number returns the internal bus number which the given USB device belongs to. Valid bus numbers start at zero. . .Pp . .Fn libusb20_dev_get_mode returns the current operation mode of the USB entity. . Valid return values are: .Bl -tag -width "LIBUSB20_MODE_DEVICE" .It LIBUSB20_MODE_HOST .It LIBUSB20_MODE_DEVICE .El . .Pp . .Fn libusb20_dev_get_speed returns the current speed of the given USB device. . .Bl -tag -width "LIBUSB20_SPEED_VARIABLE" .It LIBUSB20_SPEED_UNKNOWN .It LIBUSB20_SPEED_LOW .It LIBUSB20_SPEED_FULL .It LIBUSB20_SPEED_HIGH .It LIBUSB20_SPEED_VARIABLE .It LIBUSB20_SPEED_SUPER .El . .Pp . .Fn libusb20_dev_get_config_index returns the currently selected config index for the given USB device. . .Pp . .Fn libusb20_dev_free will free the given USB device and all associated USB transfers. . .Pp . .Fn libusb20_dev_set_debug will set the debug level for the given USB device. . .Pp . .Fn libusb20_dev_wait_process will wait until a pending USB transfer has completed on the given USB device. . A timeout value can be specified which is passed on to the .Xr poll 2 function. . .Sh USB BACKEND OPERATIONS . .Fn libusb20_be_get_template will return the currently selected global USB device side mode template into the integer pointer .Fa ptemp . This function returns zero on success else a LIBUSB20_ERROR value is returned. . .Pp . .Fn libusb20_be_set_template will set the global USB device side mode template to .Fa temp . The new template is not activated until after the next USB enumeration. The template number decides how the USB device will present itself to the USB Host, like Mass Storage Device, USB Ethernet Device. Also see the .Xr usb2_template 4 module. This function returns zero on success else a LIBUSB20_ERROR value is returned. . .Pp . .Fn libusb20_be_get_dev_quirk will return the device quirk according to .Fa index into the libusb20_quirk structure pointed to by .Fa pq . This function returns zero on success else a LIBUSB20_ERROR value is returned. . If the given quirk does not exist LIBUSB20_ERROR_NOT_FOUND is returned. . .Pp . .Fn libusb20_be_get_quirk_name will return the quirk name according to .Fa index into the libusb20_quirk structure pointed to by .Fa pq . This function returns zero on success else a LIBUSB20_ERROR value is returned. . If the given quirk does not exist LIBUSB20_ERROR_NOT_FOUND is returned. . .Pp . .Fn libusb20_be_add_dev_quirk will add the libusb20_quirk structure pointed to by the .Fa pq argument into the device quirk list. . This function returns zero on success else a LIBUSB20_ERROR value is returned. . If the given quirk cannot be added LIBUSB20_ERROR_NO_MEM is returned. . .Pp . .Fn libusb20_be_remove_dev_quirk will remove the quirk matching the libusb20_quirk structure pointed to by the .Fa pq argument from the device quirk list. . This function returns zero on success else a LIBUSB20_ERROR value is returned. . If the given quirk does not exist LIBUSB20_ERROR_NOT_FOUND is returned. . .Pp . .Fn libusb20_be_alloc_default .Fn libusb20_be_alloc_freebsd .Fn libusb20_be_alloc_linux These functions are used to allocate a specific USB backend or the operating system default USB backend. Allocating a backend is a way to scan for currently present USB devices. . .Pp . .Fn libusb20_be_device_foreach is used to iterate USB devices present in a USB backend. . The starting value of .Fa pdev is NULL. . This function returns the next USB device in the list. . If NULL is returned the end of the USB device list has been reached. . .Pp . .Fn libusb20_be_dequeue_device will dequeue the given USB device pointer from the backend USB device list. . Dequeued USB devices will not be freed when the backend is freed. . .Pp . .Fn libusb20_be_enqueue_device will enqueue the given USB device pointer in the backend USB device list. . Enqueued USB devices will get freed when the backend is freed. . .Pp . .Fn libusb20_be_free will free the given backend and all USB devices in its device list. . . .Sh USB DESCRIPTOR PARSING . .Fn libusb20_me_get_1 pie offset This function will return a byte at the given byte offset of a message entity. . This function is safe against invalid offsets. . .Pp . .Fn libusb20_me_get_2 pie offset This function will return a little endian 16-bit value at the given byte offset of a message entity. . This function is safe against invalid offsets. . .Pp . .Fn libusb20_me_encode pbuf len pdecoded This function will encode a so-called *DECODED structure into binary format. . The total encoded length that will fit in the given buffer is returned. . If the buffer pointer is NULL no data will be written to the buffer location. . .Pp . .Fn libusb20_me_decode pbuf len pdecoded This function will decode a binary structure into a so-called *DECODED structure. . The total decoded length is returned. . The buffer pointer cannot be NULL. . . .Sh USB DEBUGGING .Ft const char * .Fn libusb20_strerror "int code" Get the ASCII representation of the error given by the .Fa code argument. This function does not return NULL. .Pp .Ft const char * .Fn libusb20_error_name "int code" Get the ASCII representation of the error enum given by the .Fa code argument. This function does not return NULL. . .Sh FILES .Bl -tag -width Pa .It Pa /dev/usb .El .Sh SEE ALSO -.Xr usb 4 , .Xr libusb 3 , +.Xr usb 4 , .Xr usbconfig 8 , .Xr usbdump 8 . . .Sh HISTORY . . Some parts of the .Nm API derives from the libusb project at sourceforge. Index: head/lib/libutil/quotafile.3 =================================================================== --- head/lib/libutil/quotafile.3 (revision 276293) +++ head/lib/libutil/quotafile.3 (revision 276294) @@ -1,290 +1,290 @@ .\"- .\" Copyright (c) 2009 Dag-Erling Coïdan Smørgrav and .\" Marshall Kirk McKusick. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $FreeBSD$ .\" .Dd December 28, 2009 .Dt QUOTAFILE 3 .Os .Sh NAME .Nm quota_open .Nm quota_close .Nm quota_on .Nm quota_off .Nm quota_read .Nm quota_write_limits .Nm quota_write_usage .Nm quota_fsname .Nm quota_qfname .Nm quota_maxid .Nm quota_check_path .Nm quota_convert .Nd "Manipulate quotas" .Sh LIBRARY .Lb libutil .Sh SYNOPSIS .In sys/param.h .In sys/mount.h .In ufs/ufs/quota.h .In fcntl.h .In fstab.h .In libutil.h .Ft "struct quotafile *" .Fn quota_open "struct fstab *fs" "int quotatype" "int openflags" .Ft int .Fn quota_close "struct quotafile *qf" .Ft int .Fn quota_on "const struct quotafile *qf" .Ft int .Fn quota_off "const struct quotafile *qf" .Ft int .Fn quota_read "struct quotafile *qf" "struct dqblk *dqb" "int id" .Ft int .Fn quota_write_limits "struct quotafile *qf" "struct dqblk *dqb" "int id" .Ft int .Fn quota_write_usage "struct quotafile *qf" "struct dqblk *dqb" "int id" .Ft "const char *" .Fn quota_fsname "const struct quotafile *qf" .Ft "const char *" .Fn quota_qfname "const struct quotafile *qf" .Ft int .Fn quota_maxid "const struct quotafile *qf" .Ft int .Fn quota_check_path "const struct quotafile *qf" "const char *path" .Ft int .Fn quota_convert "struct quotafile *qf" "int wordsize" .Sh DESCRIPTION These functions are designed to simplify access to filesystem quotas. If quotas are active on a filesystem, these functions will access them directly from the kernel using the .Fn quotactl system call. If quotas are not active, these functions will access them by reading and writing the quota files directly. .Pp The .Fn quota_open function takes a pointer to an .Vt fstab entry corresponding to the filesystem on which quotas are to be accessed. The .Va quotatype field indicates the type of quotas being sought, either .Dv USRQUOTA or .Dv GRPQUOTA . The .Va openflags are those used by the .Fn open system call, usually either .Dv O_RDONLY if the quotas are just to be read, or .Dv O_RDWR if the quotas are to be updated. The .Dv O_CREAT flag should be specified if a new quota file of the requested type should be created if it does not already exist. .Pp The .Fn quota_close function closes any open file descriptors and frees any storage associated with the filesystem and quota type referenced by .Va qf . .Pp The .Fn quota_on function enables quotas for the filesystem associated with its .Va qf argument which may have been opened with .Dv O_RDONLY or .Dv O_RDWR . The .Fn quota_on function returns 0 if successful; otherwise the value\~-1 is returned and the global variable .Va errno is set to indicate the error, see .Xr quotactl 2 for the possible errors. .Pp The .Fn quota_off function disables quotas for the filesystem associated with its .Va qf argument which may have been opened with .Dv O_RDONLY or .Dv O_RDWR . The .Fn quota_off function returns 0 if successful; otherwise the value\~-1 is returned and the global variable .Va errno is set to indicate the error, see .Xr quotactl 2 for the possible errors. .Pp The .Fn quota_read function reads the quota from the filesystem and quota type referenced by .Va qf for the user (or group) specified by .Va id into the .Vt dqblk quota structure pointed to by .Va dqb . .Pp The .Fn quota_write_limits function updates the limit fields (but not the usage fields) for the filesystem and quota type referenced by .Va qf for the user (or group) specified by .Va id from the .Vt dqblk quota structure pointed to by .Va dqb . .Pp The .Fn quota_write_usage function updates the usage fields (but not the limit fields) for the filesystem and quota type referenced by .Va qf for the user (or group) specified by .Va id from the .Vt dqblk quota structure pointed to by .Va dqb . .Pp The .Fn quota_fsname function returns a pointer to a buffer containing the path to the root of the file system that corresponds to its .Va qf argument, as listed in .Pa /etc/fstab . Note that this may be a symbolic link to the actual directory. .Pp The .Fn quota_qfname function returns a pointer to a buffer containing the name of the quota file that corresponds to its .Va qf argument. Note that this may be a symbolic link to the actual file. .Pp The .Fn quota_maxid function returns the maximum user (or group) .Va id contained in the quota file associated with its .Va qf argument. .Pp The .Fn quota_check_path function checks if the specified path is within the filesystem that corresponds to its .Va qf argument. If the .Va path argument refers to a symbolic link, .Fn quota_check_path will follow it. .Pp The .Fn quota_convert function converts the quota file associated with its .Va qf argument to the data size specified by its .Va wordsize argument. The supported wordsize arguments are 32 for the old 32-bit quota file format and 64 for the new 64-bit quota file format. The .Fn quota_convert function may only be called to operate on quota files that are not currently active. .Sh IMPLEMENTATION NOTES If the underlying quota file is in or converted to the old 32-bit format, limit and usage values written to the quota file will be clipped to 32 bits. .Sh RETURN VALUES If the filesystem has quotas associated with it, .Fn quota_open returns a pointer to a .Vt quotafile structure used in subsequent quota access calls. If the filesystem has no quotas, or access permission is denied .Dv NULL is returned and .Va errno is set to indicate the error. .Pp The .Fn quota_check_path function returns\~1 for a positive result and\~0 for a negative result. If an error occurs, it returns\~-1 and sets .Va errno to indicate the error. .Pp The .Fn quota_read , .Fn quota_write_limits , .Fn quota_write_usage , .Fn quota_convert , and .Fn quota_close functions return zero on success. On error they return\~-1 and set .Va errno to indicate the error. .Sh SEE ALSO .Xr quotactl 2 , -.Xr quota.user 5 , -.Xr quota.group 5 +.Xr quota.group 5 , +.Xr quota.user 5 .Sh HISTORY The .Nm quotafile functions first appeared in .Fx 8.1 . .Sh AUTHORS .An -nosplit The .Nm quotafile functions and this manual page were written by .An Dag-Erling Sm\(/orgrav Aq Mt des@FreeBSD.org and .An Marshall Kirk McKusick Aq Mt mckusick@mckusick.com .