[Chapel Merge] Add `OS` and `OS.POSIX` modules and convert some u

Branch: refs/heads/main
Revision: c5c36ca
Author: gbtitus
Link: Add `OS` and `OS.POSIX` modules and convert some uses of `Sys`. by gbtitus · Pull Request #19632 · chapel-lang/chapel · GitHub
Log Message:

Merge pull request #19632 from gbtitus/OS-module

Add OS and OS.POSIX modules and convert some uses of Sys.

(Reviewed and improved by @mppf -- thanks!)

As part of module stabilization we are moving from the existing Sys
module to an OS module with POSIX and other submodules, which provide
definitions matching the corresponding operating system standards as
closely as Chapel can manage. Here, add the initial OS.POSIX module
along with tests which exercise (though not exhaustively) what is
supported so far. All of the tests pass on both Darwin and Linux. In
addition, update some but not all of the module code and tests that used
Sys to use OS.POSIX instead.

The supported POSIX symbols in this initial implementation are the errno
variable (read-only) and many of the errno E* values along with the
following functions and their associated types and constants:

getenv()

strerror()
strlen()

creat()
open()
close()
read()
write()
pipe()

FD_CLR()
FD_ISSET()
FD_SET()
FD_ZERO()
select(), as select_posix() because select is a Chapel keyword

chmod()
stat()

localtime()
localtime_r()
asctime()
asctime_r()
gettimeofday()
time()

(There wasn't a final review after the last commit but that commit only
changes pipe() which is not yet referenced outside of the OS.POSIX
module-specific tests, so I think it's pretty safe.)

Modified Files:
A modules/standard/OS.chpl

A runtime/include/os-module-support/posix.h
A test/modules/OS.skipif
A test/modules/OS/POSIX.skipif
A test/modules/OS/POSIX/chmod.chpl
A test/modules/OS/POSIX/chmod.cleanfiles
A test/modules/OS/POSIX/chmod.good
A test/modules/OS/POSIX/chmod.prediff
A test/modules/OS/POSIX/chmod.preexec
A test/modules/OS/POSIX/errno.chpl
A test/modules/OS/POSIX/errno.good
A test/modules/OS/POSIX/fd_set.chpl
A test/modules/OS/POSIX/fd_set.good
A test/modules/OS/POSIX/getenv.chpl
A test/modules/OS/POSIX/getenv.execenv
A test/modules/OS/POSIX/getenv.good
A test/modules/OS/POSIX/gettimeofday.chpl
A test/modules/OS/POSIX/gettimeofday.good
A test/modules/OS/POSIX/gettimeofday.prediff
A test/modules/OS/POSIX/localtime.chpl
A test/modules/OS/POSIX/localtime.good
A test/modules/OS/POSIX/localtime.prediff
A test/modules/OS/POSIX/open.chpl
A test/modules/OS/POSIX/open.cleanfiles
A test/modules/OS/POSIX/open.good
A test/modules/OS/POSIX/open.prediff
A test/modules/OS/POSIX/pipe.chpl
A test/modules/OS/POSIX/pipe.good
A test/modules/OS/POSIX/pipe.skipif
A test/modules/OS/POSIX/select.chpl
A test/modules/OS/POSIX/select.good
A test/modules/OS/POSIX/select.prediff
A test/modules/OS/POSIX/select.skipif
A test/modules/OS/POSIX/stat.chpl
A test/modules/OS/POSIX/stat.good
A test/modules/OS/POSIX/stat.prediff
A test/modules/OS/POSIX/string.chpl
A test/modules/OS/POSIX/string.good
A test/modules/OS/POSIX/time.chpl
A test/modules/OS/POSIX/time.good
A test/modules/OS/POSIX/time.prediff
R test/users/ferguson/sys/getenv.skipif
R test/users/ferguson/sys/getenv/getenv.chpl
R test/users/ferguson/sys/getenv/getenv.execenv
R test/users/ferguson/sys/getenv/getenv.good
M doc/rst/meta/modules/standard.rst
M modules/Makefile
M modules/internal/LocaleModelHelpSetup.chpl
M runtime/include/stdchpl.h
M test/compflags/ferguson/print-module-resolution.good
M test/execflags/gbt/shell-meta-env.chpl
M test/extern/kbrady/rename_extern_record.chpl
M test/io/ferguson/open-remote-string.chpl
M test/modules/bradc/printModStuff/foo.good
M test/modules/sungeun/init/printModuleInitOrder.good
M test/modules/sungeun/init/printModuleInitOrder.na-none.good
M test/runtime/configMatters/comm/ugni/SIGBUS-array-alloc.chpl
M test/runtime/configMatters/comm/ugni/SIGBUS-heap-extend.chpl

Compare: https://github.com/chapel-lang/chapel/compare/227763f22c01...c5c36ca955b1