public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug manual/27207] New: mount examples don't match the mount function signature
@ 2021-01-19 18:07 john at mccabe dot org.uk
2021-01-19 18:07 ` [Bug manual/27207] " john at mccabe dot org.uk
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: john at mccabe dot org.uk @ 2021-01-19 18:07 UTC (permalink / raw)
To: glibc-bugs
https://sourceware.org/bugzilla/show_bug.cgi?id=27207
Bug ID: 27207
Summary: mount examples don't match the mount function
signature
Product: glibc
Version: 2.32
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: manual
Assignee: unassigned at sourceware dot org
Reporter: john at mccabe dot org.uk
CC: mtk.manpages at gmail dot com
Target Milestone: ---
In section 31.3.2, "Mount, Unmount, Remount", the signature of the mount
function is declared as:
int mount (const char *special_file, const char *dir, const char *fstype,
unsigned long int options, const void *data)
Later in the documentation, the following examples are provided:
Example:
#include <sys/mount.h>
mount("/dev/hdb", "/cdrom", MS_MGC_VAL | MS_RDONLY | MS_NOSUID, "");
mount("/dev/hda2", "/mnt", MS_MGC_VAL | MS_REMOUNT, "");
Both of these examples have the options flags as the 3rd parameter, with an
empty string as the 4th. As these are MS_REMOUNT examples, it looks like the
4th parameter in the examples is meant to represent the filesystem type, so the
3rd and 4th parameters are the wrong way round.
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug manual/27207] mount examples don't match the mount function signature
2021-01-19 18:07 [Bug manual/27207] New: mount examples don't match the mount function signature john at mccabe dot org.uk
@ 2021-01-19 18:07 ` john at mccabe dot org.uk
2021-01-19 18:19 ` john at mccabe dot org.uk
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: john at mccabe dot org.uk @ 2021-01-19 18:07 UTC (permalink / raw)
To: glibc-bugs
https://sourceware.org/bugzilla/show_bug.cgi?id=27207
John McCabe <john at mccabe dot org.uk> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |john at mccabe dot org.uk
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug manual/27207] mount examples don't match the mount function signature
2021-01-19 18:07 [Bug manual/27207] New: mount examples don't match the mount function signature john at mccabe dot org.uk
2021-01-19 18:07 ` [Bug manual/27207] " john at mccabe dot org.uk
@ 2021-01-19 18:19 ` john at mccabe dot org.uk
2021-01-20 12:14 ` mtk.manpages at gmail dot com
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: john at mccabe dot org.uk @ 2021-01-19 18:19 UTC (permalink / raw)
To: glibc-bugs
https://sourceware.org/bugzilla/show_bug.cgi?id=27207
--- Comment #1 from John McCabe <john at mccabe dot org.uk> ---
More details:
Contained in sysinfo.texi:
This section:
----
@smallexample
@group
#include <sys/mount.h>
mount("/dev/hdb", "/cdrom", MS_MGC_VAL | MS_RDONLY | MS_NOSUID, "");
mount("/dev/hda2", "/mnt", MS_MGC_VAL | MS_REMOUNT, "");
@end group
@end smallexample
----
Probably needs to change to:
----
@smallexample
@group
#include <sys/mount.h>
mount("/dev/hdb", "/cdrom", "", MS_MGC_VAL | MS_RDONLY | MS_NOSUID);
mount("/dev/hda2", "/mnt", "", MS_MGC_VAL | MS_REMOUNT);
@end group
@end smallexample
----
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug manual/27207] mount examples don't match the mount function signature
2021-01-19 18:07 [Bug manual/27207] New: mount examples don't match the mount function signature john at mccabe dot org.uk
2021-01-19 18:07 ` [Bug manual/27207] " john at mccabe dot org.uk
2021-01-19 18:19 ` john at mccabe dot org.uk
@ 2021-01-20 12:14 ` mtk.manpages at gmail dot com
2021-01-20 13:11 ` john at mccabe dot org.uk
2021-01-20 13:14 ` john at mccabe dot org.uk
4 siblings, 0 replies; 6+ messages in thread
From: mtk.manpages at gmail dot com @ 2021-01-20 12:14 UTC (permalink / raw)
To: glibc-bugs
https://sourceware.org/bugzilla/show_bug.cgi?id=27207
--- Comment #2 from Michael Kerrisk <mtk.manpages at gmail dot com> ---
I confirm this bug.
However, since mount(2) is not variadic, the change should probably be:
----
@smallexample
@group
#include <sys/mount.h>
mount("/dev/hdb", "/cdrom", "", MS_MGC_VAL | MS_RDONLY | MS_NOSUID, NULL);
mount("/dev/hda2", "/mnt", "", MS_MGC_VAL | MS_REMOUNT, NULL);
@end group
@end smallexample
----
(That is, add the fifth argument in each call.)
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug manual/27207] mount examples don't match the mount function signature
2021-01-19 18:07 [Bug manual/27207] New: mount examples don't match the mount function signature john at mccabe dot org.uk
` (2 preceding siblings ...)
2021-01-20 12:14 ` mtk.manpages at gmail dot com
@ 2021-01-20 13:11 ` john at mccabe dot org.uk
2021-01-20 13:14 ` john at mccabe dot org.uk
4 siblings, 0 replies; 6+ messages in thread
From: john at mccabe dot org.uk @ 2021-01-20 13:11 UTC (permalink / raw)
To: glibc-bugs
https://sourceware.org/bugzilla/show_bug.cgi?id=27207
--- Comment #3 from John McCabe <john at mccabe dot org.uk> ---
Good call; that's correct!
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug manual/27207] mount examples don't match the mount function signature
2021-01-19 18:07 [Bug manual/27207] New: mount examples don't match the mount function signature john at mccabe dot org.uk
` (3 preceding siblings ...)
2021-01-20 13:11 ` john at mccabe dot org.uk
@ 2021-01-20 13:14 ` john at mccabe dot org.uk
4 siblings, 0 replies; 6+ messages in thread
From: john at mccabe dot org.uk @ 2021-01-20 13:14 UTC (permalink / raw)
To: glibc-bugs
https://sourceware.org/bugzilla/show_bug.cgi?id=27207
--- Comment #4 from John McCabe <john at mccabe dot org.uk> ---
Created attachment 13138
--> https://sourceware.org/bugzilla/attachment.cgi?id=13138&action=edit
Proposed patch to fix it
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2021-01-20 13:14 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-19 18:07 [Bug manual/27207] New: mount examples don't match the mount function signature john at mccabe dot org.uk
2021-01-19 18:07 ` [Bug manual/27207] " john at mccabe dot org.uk
2021-01-19 18:19 ` john at mccabe dot org.uk
2021-01-20 12:14 ` mtk.manpages at gmail dot com
2021-01-20 13:11 ` john at mccabe dot org.uk
2021-01-20 13:14 ` john at mccabe dot org.uk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).