View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001323 | 1003.1(2016/18)/Issue7+TC2 | Base Definitions and Headers | public | 2020-02-07 10:10 | 2024-06-11 09:08 |
Reporter | geoffclare | Assigned To | |||
Priority | normal | Severity | Objection | Type | Clarification Requested |
Status | Closed | Resolution | Accepted As Marked | ||
Name | Geoff Clare | ||||
Organization | The Open Group | ||||
User Reference | |||||
Section | <sys/stat.h> | ||||
Page Number | 392 | ||||
Line Number | 13324 | ||||
Interp Status | --- | ||||
Final Accepted Text | See 0001323:0004778. | ||||
Summary | 0001323: st_nlink is the number of hard links in the file system | ||||
Description | The description of st_nlink is:Number of hard links to the file.The standard should make clear that st_nlink is the number of hard links in the file system, which can differ from the number in the entire file hierarchy on systems that support mounting the same file system multiple times at different mount points. | ||||
Desired Action | On page 392 line 13342 section <sys/stat.h> add a new paragraph:The st_nlink value shall be the number of hard links to the file within the file system in which the file resides. | ||||
Tags | tc3-2008 |
|
I suggest make the note indicate st_nlink as undefined, as $(st_nlink * count(mount points)) is not the actual behavior as I've observed on FreeBSD with nullfs: $ mount -l /dev/ada0s1a on / (ufs, local, journaled soft-updates) devfs on /dev (devfs, local, multilabel) /usr/home/dannyniu/sandbox on /usr/home/dannyniu/glassbox (nullfs, local) $ ls -l sandbox glassbox glassbox: total 4 -rwxr-xr-x 1 dannyniu dannyniu 246 Dec 10 10:24 data2url.php sandbox: total 4 -rwxr-xr-x 1 dannyniu dannyniu 246 Dec 10 10:24 data2url.php $ |
|
Okay, I might've mis-interpreted the "note", but nonetheless I suggest make it clearer by saying: Note: ... in which case the actual number of hard links to the file throughout the file hierarchy is st_nlink times the number of mount points for that file system (which is greater than st_nlink). |
|
I'd rather say "in which case the number of hard links to the file throughout the file hierarchy could be greater than st_nlink" as systems allow mounting *parts* of a FS (like in bind-mounts) and part of a FS can be masked by another FS (like FS2 is mounted on a non-empty directory of FS1), in which case, it could even be less than st_nlink. |
|
Seems I was fixated on the multiple-mount-points case and hadn't thought about other situations affecting the number of links that can be "found". The less-than-st_nlink case could happen even on ancient systems that don't have modern functionality like bind mounts, etc. You just need to mount another file system over the top of a non-empty directory. I'll add a note with a revised proposal. |
|
On page 392 line 13342 section <sys/stat.h> add a new paragraph:The st_nlink value shall be the number of hard links to the file within the file system in which the file resides. |
|
I agree with the clarification here, just feel what is in the Note is better as an App Usage paragraph of its own, rather than in the normative part. |
Date Modified | Username | Field | Change |
---|---|---|---|
2020-02-07 10:10 | geoffclare | New Issue | |
2020-02-07 10:10 | geoffclare | Name | => Geoff Clare |
2020-02-07 10:10 | geoffclare | Organization | => The Open Group |
2020-02-07 10:10 | geoffclare | Section | => <sys/stat.h> |
2020-02-07 10:10 | geoffclare | Page Number | => 392 |
2020-02-07 10:10 | geoffclare | Line Number | => 13324 |
2020-02-07 10:10 | geoffclare | Interp Status | => --- |
2020-02-07 11:55 | dannyniu | Note Added: 0004774 | |
2020-02-07 11:56 | dannyniu | Note Edited: 0004774 | |
2020-02-07 12:27 | dannyniu | Note Added: 0004775 | |
2020-02-07 13:24 | stephane | Note Added: 0004776 | |
2020-02-07 14:27 | geoffclare | Note Added: 0004777 | |
2020-02-07 14:41 | geoffclare | Note Added: 0004778 | |
2020-02-07 18:22 | shware_systems | Note Added: 0004779 | |
2020-10-12 15:33 | Don Cragun | Final Accepted Text | => See 0001323:0004778. |
2020-10-12 15:33 | Don Cragun | Status | New => Resolved |
2020-10-12 15:33 | Don Cragun | Resolution | Open => Accepted As Marked |
2020-10-12 15:33 | Don Cragun | Tag Attached: tc3-2008 | |
2020-12-04 16:39 | geoffclare | Status | Resolved => Applied |
2024-06-11 09:08 | agadmin | Status | Applied => Closed |