.\" Copyright 2008, Linux Foundation, written by Michael Kerrisk
.\" <mtk.manpages@gmail.com>
.\"
+.\" %%%LICENSE_START(VERBATIM)
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
+.\" %%%LICENSE_END
.\"
-.TH GETSERVENT_R 3 2008-08-19 "GNU" "Linux Programmer's Manual"
+.TH GETSERVENT_R 3 2010-09-10 "GNU" "Linux Programmer's Manual"
.SH NAME
getservent_r, getservbyname_r, getservbyport_r \- get
service entry (reentrant)
.BR getservent_r (),
.BR getservbyname_r (),
.BR getservbyport_r ():
+.RS 4
_BSD_SOURCE || _SVID_SOURCE
+.RE
.ad b
.SH DESCRIPTION
The
otherwise,
.I *result
is set to NULL.
-.SH "RETURN VALUE"
+.SH RETURN VALUE
On success, these functions return 0.
-On error, a positive error number is returned.
+On error, they return one of the positive error numbers listed in errors.
On error, record not found
.RB ( getservbyname_r (),
Try again with a larger buffer
(and increased
.IR buflen ).
-.SH "CONFORMING TO"
+.SH CONFORMING TO
These functions are GNU extensions.
Functions with similar names exist on some other systems,
though typically with different calling signatures.
char **p;
if (argc < 3) {
- printf("Usage: %s port\-num proto-name [buflen]\\n", argv[0]);
+ printf("Usage: %s port\-num proto\-name [buflen]\\n", argv[0]);
exit(EXIT_FAILURE);
}
port = htons(atoi(argv[1]));
protop = (strcmp(argv[2], "null") == 0 ||
- strcmp(argv[2], "NULL") == 0) ? NULL : argv[2];
+ strcmp(argv[2], "NULL") == 0) ? NULL : argv[2];
buflen = 1024;
if (argc > 3)
exit(EXIT_SUCCESS);
}
.fi
-.SH "SEE ALSO"
+.SH SEE ALSO
.BR getservent (3),
.BR services (5)
+.SH COLOPHON
+This page is part of release 3.79 of the Linux
+.I man-pages
+project.
+A description of the project,
+information about reporting bugs,
+and the latest version of this page,
+can be found at
+\%http://www.kernel.org/doc/man\-pages/.