Thibault MEYER | 1 Jul 2012 10:08
Picon
Favicon
Gravatar

[manpage] man 3 register_printf_specifier

.\" Copyright (c) 2012 Thibault Meyer (thibault.meyer@...)
.\"
.\" This is free documentation; you can redistribute it and/or
.\" modify it under the terms of the GNU General Public License as
.\" published by the Free Software Foundation; either version 2 of
.\" the License, or (at your option) any later version.
.\"
.\" The GNU General Public License's references to "object code"
.\" and "executables" are to be interpreted as the output of any
.\" document formatting or typesetting system, including
.\" intermediate and printed output.
.\"
.\" This manual is distributed in the hope that it will be useful,
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
.\" GNU General Public License for more details.
.\"
.\" You should have received a copy of the GNU General Public
.\" License along with this manual; if not, write to the Free
.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
.\" USA.
.\"
.TH REGISTER_PRINTF_SPECIFIER 3 2011-12-08 "GNU" "Linux Programmer's Manual"
.SH NAME
register_printf_specifier \- Add new format specifier to printf function
.SH SYNOPSIS
.B #include <printf.h>
.sp
.BI "typedef int printf_function (FILE *"stream ",struct printf_info
*" info ", void **"args ");"
(Continue reading)

Nadav Har'El | 2 Jul 2012 20:52
Picon
Favicon

Missing info in atoi(3)

Hi, I found a peculiar behavior in atoi() which isn't explained in
atoi(3) - at least not in release 3.35 of the manual I have in Fedora 17.

atoi() returns an int, but I expected that I can do

	unsigned int i = atoi(...);

and it will just work fine, for any number - including numbers between
2^31 and 2^32. Any naive implementation of atoi(), repeatedly multiplying by
10 and adding the next digit, would have worked in this case just fine.
But unfortunately, glibc's atoi() actually does something different in
this case - for numbers >=2^31, it returns 2^31-1! The line above actually
returned the wrong result on half the unsigned integer range :( I tested this
on a 32-bit installation on Linux, by the way - I don't know if this makes
a difference.

I think it should be clearly state in atoi(3) what it does for numbers
larger than 2^31 (or however this limit is actually defined in the
code), and perhaps even explain why. I think it it should also be noted
that atoi() is therefore unsuitable for reading unsigned ints - and
for this purpose strtoul() should be preferred.

Finally, atoi(3) states that "[its] The behavior is the same as 
strtol(nptr, (char **) NULL, 10); except that atoi() does not detect errors."
In my test, this is NOT true - for numbers between 2^31 and 2^32 return
different things in both functions (the correct number in strtoul, or
2^31-1 for atoi), and neither returns an error.
	
--

-- 
Nadav Har'El                        |       Monday, Jul 2 2012, 13 Tammuz 5772
(Continue reading)

Elie De Brauwer | 3 Jul 2012 22:18
Picon
Gravatar

(unknown)

subscribe linux-man
--

-- 
Elie De Brauwer

--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo@...
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Simon Paillard | 3 Jul 2012 22:19
Picon
Picon
Favicon

Re: your mail

On Tue, Jul 03, 2012 at 10:18:35PM +0200, Elie De Brauwer wrote:
> subscribe linux-man

Not to the list, to majordomo itself:
http://vger.kernel.org/majordomo-info.html#subscription

--

-- 
Simon Paillard
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo@...
More majordomo info at  http://vger.kernel.org/majordomo-info.html

pacman | 5 Jul 2012 02:50

fixes for lockf.3

In lockf(3), the description of EDEADLK says that it can occur with the
T_LOCK operation. That should be F_LOCK. The presence of the T makes it look
like maybe F_TLOCK was intended, but that would be wrong. Only the blocking
F_LOCK operation can cause EDEADLK.

Also, I was looking through Changes.old for the last few versions, and
noticed that fcntl.h was misspelled fntl.h a couple of times.

--

-- 
Alan Curry
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo@...
More majordomo info at  http://vger.kernel.org/majordomo-info.html

bugzilla | 5 Jul 2012 18:15

[Bug 15568] O_NONBLOCK is NOOP on block devices

https://bugzilla.kernel.org/show_bug.cgi?id=15568

Alan <alan@...> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |alan@...
         Resolution|                            |OBSOLETE

--

-- 
Configure bugmail: https://bugzilla.kernel.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo@...
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Henry Hu | 5 Jul 2012 21:10
Picon
Gravatar

Spelling error in getutent(3)

Hi,

I've just spotted an error in man page getutent(3).

In the last paragraph of the section "CONFORMING TO", it says

Linux glibc on the other hand does not use a parallel utmpx file since its
utmp structure is already large enough.  The "x" functions listed above are
just aliases for their counterparts without the "x" (e.g., getutxent() is
an alias for gettutent()).

It seems like that the last "gettutent" should be "getutent".

--

-- 
Cheers,
Henry
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo@...
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Simon Paillard | 5 Jul 2012 22:34
Picon
Favicon

[PATCH] regex.3: detailed reference to GNU libc regex manual

http://www.gnu.org/software/libc/manual/html_node/Regular-Expressions.html

Following review of Debian patches
<CAKgNAkjG47WTi7CYtM20k-uNEDRcSncTaMxhfU6_DU1hsoYQSg@...>
---
 man3/regex.3 |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/man3/regex.3 b/man3/regex.3
index 7cd8f6b..6500576 100644
--- a/man3/regex.3
+++ b/man3/regex.3
 <at>  <at>  -296,4 +296,5  <at>  <at>  POSIX.1-2001.
 .SH "SEE ALSO"
 .BR grep (1),
 .BR regex (7),
-GNU regex manual
+the glibc manual section
+.I "Regular Expression Matching"
--

-- 
1.7.10

--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo@...
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Adrian Dabrowski | 5 Jul 2012 23:33
Picon

getifaddrs()

Version: manpages-dev 3.27-1ubuntu2

The example program source produces a Seg-Fault, when a device does not 
have an ifa->ifa_addr. (e.g. openvpn-tunnels, probably others (dialup?))

ORIGINAL:
            for (ifa = ifaddr; ifa != NULL; ifa = ifa->ifa_next) {
                family = ifa->ifa_addr->sa_family;

POSSIBLE FIX:
            for (ifa = ifaddr; ifa != NULL; ifa = ifa->ifa_next) {
		if (ifa->ifa_addr != NULL)
                		family = ifa->ifa_addr->sa_family;
		else
			family = -1;

Also it is not documented, that  struct sockaddr *ifa_addr  might be NULL.

best wishes and keep up the good work,
Adrian Dabrowski
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo@...
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Simon Paillard | 6 Jul 2012 21:29
Picon
Picon
Favicon

Re: getifaddrs()

Hi,

On Thu, Jul 05, 2012 at 11:33:06PM +0200, Adrian Dabrowski wrote:
> Version: manpages-dev 3.27-1ubuntu2

You should upgrade your manpages-dev version:
http://packages.ubuntu.com/search?keywords=manpages-dev 

> The example program source produces a Seg-Fault, when a device does
> not have an ifa->ifa_addr. (e.g. openvpn-tunnels, probably others
> (dialup?))

Thanks for reporting the issue, don't hesitate to report similar reports *that
still apply in current version*.

> ORIGINAL:
>            for (ifa = ifaddr; ifa != NULL; ifa = ifa->ifa_next) {
>                family = ifa->ifa_addr->sa_family;

http://man7.org/linux/man-pages/man3/getifaddrs.3.html

           for (ifa = ifaddr; ifa != NULL; ifa = ifa->ifa_next) {
               if (ifa->ifa_addr == NULL)
                   continue;

               family = ifa->ifa_addr->sa_family; 

It has been fixed by
http://git.kernel.org/?p=docs/man-pages/man-pages.git;a=commitdiff;h=ebd05fecfe

(Continue reading)


Gmane