All of lore.kernel.org
 help / color / mirror / Atom feed
* rfc: free and errno
@ 2021-02-01 11:17 Walter Harms
  2021-02-06  9:49 ` Michael Kerrisk (man-pages)
  0 siblings, 1 reply; 3+ messages in thread
From: Walter Harms @ 2021-02-01 11:17 UTC (permalink / raw)
  To: linux-man

Hi List

free() is generaly assumed not to modify errno. 

Lately there was a bugfix posting on the busybox mailing list, because:

"musl libc's mallocing free() may modify errno if kernel does not support
MADV_FREE which causes echo to echo with error when it shouldn't."

In future  it seems that POSIX with require free() not to change errno.

after much soul searching i have still no idea if that should be documented in
the free(3) man page. Any comments ?

re,
 wh

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: rfc: free and errno
  2021-02-01 11:17 rfc: free and errno Walter Harms
@ 2021-02-06  9:49 ` Michael Kerrisk (man-pages)
  2021-02-06 10:42   ` Jakub Wilk
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Kerrisk (man-pages) @ 2021-02-06  9:49 UTC (permalink / raw)
  To: Walter Harms; +Cc: linux-man, Michael Kerrisk

Hello Walter,

Thanks for raising this.

On Mon, 1 Feb 2021 at 12:19, Walter Harms <wharms@bfs.de> wrote:
>
> Hi List
>
> free() is generaly assumed not to modify errno.
>
> Lately there was a bugfix posting on the busybox mailing list, because:
>
> "musl libc's mallocing free() may modify errno if kernel does not support
> MADV_FREE which causes echo to echo with error when it shouldn't."

URL please.

> In future  it seems that POSIX with require free() not to change errno.

The statement you make in the preceding sentence is useful
information, but you could save other people a lot of time searching
if you provided a reference:

https://www.austingroupbugs.net/view.php?id=385#c713

> after much soul searching i have still no idea if that should be documented in
> the free(3) man page. Any comments ?

Probably it should be documented. Did you have a suggestion for the text?

Thanks,

Michael

-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: rfc: free and errno
  2021-02-06  9:49 ` Michael Kerrisk (man-pages)
@ 2021-02-06 10:42   ` Jakub Wilk
  0 siblings, 0 replies; 3+ messages in thread
From: Jakub Wilk @ 2021-02-06 10:42 UTC (permalink / raw)
  To: Michael Kerrisk; +Cc: Walter Harms, linux-man

* Michael Kerrisk <mtk.manpages@gmail.com>, 2021-02-06, 10:49:
>On Mon, 1 Feb 2021 at 12:19, Walter Harms <wharms@bfs.de> wrote:
>>free() is generaly assumed not to modify errno.
>>
>>Lately there was a bugfix posting on the busybox mailing list, because:
>>
>>"musl libc's mallocing free() may modify errno if kernel does not 
>>support MADV_FREE which causes echo to echo with error when it 
>>shouldn't."
>
>URL please.

http://lists.busybox.net/pipermail/busybox/2021-January/088491.html 
probably.

glibc's free() also can set errno in some circumstances:
https://sourceware.org/bugzilla/show_bug.cgi?id=17924

-- 
Jakub Wilk

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-02-06 11:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-01 11:17 rfc: free and errno Walter Harms
2021-02-06  9:49 ` Michael Kerrisk (man-pages)
2021-02-06 10:42   ` Jakub Wilk

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.