klange / toaruos

A completely-from-scratch hobby operating system: bootloader, kernel, drivers, C library, and userspace including a composited graphical UI, dynamic linker, syntax-highlighting text editor, network stack, etc.
https://toaruos.org/
University of Illinois/NCSA Open Source License
6.03k stars 475 forks source link

Replace magic numbers with syscall constants in libc/unistd #181

Closed connorkuehl closed 5 years ago

connorkuehl commented 5 years ago

Summary

Many of the system call wrappers in unistd already use the constants defined in the <syscall_nums.h> header file. This patch makes that consistent across all of the functions in unistd.

Testing:

Double-checked that each named constant's value was the same as the magic number before replacing it in source code.

Clean compile and boot. Played around with user commands in /bin which exercise various system calls. System's still stable.

klange commented 5 years ago

I manually squashed this into a larger commit that moves the remaining DEFN_SYSCALLs into their respective libc wrapper implementations.