Page MenuHomeFreeBSD

syscalls: Avoid C++ reserved words
ClosedPublic

Authored by des on Fri, Sep 4, 11:04 AM.
Tags
None
Referenced Files
F170621798: D59386.diff
Sat, Sep 5, 4:40 PM
F170620875: D59386.diff
Sat, Sep 5, 4:35 PM
Unknown Object (File)
Fri, Sep 4, 11:03 PM
Unknown Object (File)
Fri, Sep 4, 5:16 PM
Unknown Object (File)
Fri, Sep 4, 11:46 AM
Unknown Object (File)
Fri, Sep 4, 11:45 AM
Subscribers

Details

Summary

Both kern_renameat() and kern_dup() had arguments named new. Rename
their arguments to match their respecitve manual pages.

Sponsored by: Klara, Inc.
Sponsored by: NetApp, Inc.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

des requested review of this revision.Fri, Sep 4, 11:04 AM
sys/kern/kern_descrip.c
1043

Usually we use suffix 'fd' for something that is file descriptor. Why not name the args oldfd and newfd?

You already used the the pattern for other chunks in the diff.

des marked an inline comment as done.Fri, Sep 4, 2:52 PM
des added inline comments.
sys/kern/kern_descrip.c
1043

The answer is in the commit message.

kib added inline comments.
sys/kern/kern_descrip.c
1043

Man page is for userspace, there we are in kernel and it would be better to follow the in-kernel naming conventions than userspace man page.

But do a you want.

This revision is now accepted and ready to land.Fri, Sep 4, 2:55 PM
des marked 2 inline comments as done.Fri, Sep 4, 2:58 PM
des added inline comments.
sys/kern/kern_descrip.c
1043

It seemed preferable to pick names for which there was precedent _somewhere_ rather than make up my own.

I would like to point out, though, that unlike renameat(2), dup(2) is not only used for files, so fd does not seem appropriate.

sys/kern/kern_descrip.c
1043

Yes, and I point to the dup(2) man page to be outlier instead of the kernel parameters name.
Unix tradition is to name descriptor indexes 'file descriptors', whatever they point to (they always point to struct file in kernel FWIW).

This revision was automatically updated to reflect the committed changes.
des marked an inline comment as done.