Skip to content

Commit

Permalink
Merge pull request #20126 from jeremiah-corrado/dep_sys_mod
Browse files Browse the repository at this point in the history
Deprecate the Sys module
  • Loading branch information
jeremiah-corrado authored Jul 11, 2022
2 parents a145718 + bb9d481 commit 04da6a5
Show file tree
Hide file tree
Showing 38 changed files with 771 additions and 209 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ cmake-build-*/
/test/memory/shannon/jacobi.log
/test/memory/shannon/configVarFile.log

/test/library/packages/Socket.compopts
/test/library/packages/HDF5/ex_lite1.h5
/test/library/packages/HDF5/ex_lite3.h5
/test/library/packages/ZMQ/getLastEndpointHelper
Expand Down
20 changes: 8 additions & 12 deletions modules/packages/Curl.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,6 @@ Curl Support Types and Functions
*/
module Curl {
public use IO, CTypes;
use Sys;
use OS.POSIX;
import SysBasic.{syserr,ENOERR};

Expand Down Expand Up @@ -505,7 +504,6 @@ module Curl {
import Time;
use IO;
use Curl;
use Sys;
use CTypes;
use OS.POSIX;
import SysBasic.{syserr,ENOERR,EEOF};
Expand Down Expand Up @@ -931,9 +929,9 @@ module Curl {
if timeoutMillis < 0 then
timeoutMillis = 0;

var timeout:timeval;
timeout.tv_sec = timeoutMillis / 1000;
timeout.tv_usec = (timeoutMillis % 1000) * 1000;
var timeout:struct_timeval;
timeout.tv_sec = (timeoutMillis / 1000):time_t;
timeout.tv_usec = ((timeoutMillis % 1000) * 1000):suseconds_t;

mcode = curl_multi_fdset(curlm, c_ptrTo(fdread), c_ptrTo(fdwrite), c_ptrTo(fdexcept), maxfd);
if mcode != CURLM_OK then
Expand All @@ -950,8 +948,7 @@ module Curl {
Time.sleep(waitSeconds);
} else {
//writeln("selecting ", timeoutMillis);
var nset:c_int;
serr = Sys.sys_select(maxfd+1, c_ptrTo(fdread), c_ptrTo(fdwrite), c_ptrTo(fdexcept), c_ptrTo(timeout), nset);
serr = POSIX.select_posix(maxfd+1, c_ptrTo(fdread), c_ptrTo(fdwrite), c_ptrTo(fdexcept), c_ptrTo(timeout));
if serr != 0 then
return serr;
}
Expand Down Expand Up @@ -1074,9 +1071,9 @@ module Curl {
if timeoutMillis < 0 then
timeoutMillis = 0;

var timeout:timeval;
timeout.tv_sec = timeoutMillis / 1000;
timeout.tv_usec = (timeoutMillis % 1000) * 1000;
var timeout:struct_timeval;
timeout.tv_sec = (timeoutMillis / 1000):time_t;
timeout.tv_usec = ((timeoutMillis % 1000) * 1000):suseconds_t;

mcode = curl_multi_fdset(curlm, c_ptrTo(fdread), c_ptrTo(fdwrite), c_ptrTo(fdexcept), maxfd);
if mcode != CURLM_OK then
Expand All @@ -1093,8 +1090,7 @@ module Curl {
Time.sleep(waitSeconds);
} else {
//writeln("selecting ", timeoutMillis);
var nset:c_int;
serr = Sys.sys_select(maxfd+1, c_ptrTo(fdread), c_ptrTo(fdwrite), c_ptrTo(fdexcept), c_ptrTo(timeout), nset);
serr = POSIX.select_posix(maxfd+1, c_ptrTo(fdread), c_ptrTo(fdwrite), c_ptrTo(fdexcept), c_ptrTo(timeout));
if serr != 0 then
return serr;
}
Expand Down
3 changes: 2 additions & 1 deletion modules/packages/HDF5.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ module HDF5 {
https://portal.hdfgroup.org/display/HDF5/HDF5
*/
module C_HDF5 {
public use CTypes, Sys;
public use CTypes;
public use OS.POSIX only off_t;

// Header given to c2chapel:
require "hdf5_hl.h";
Expand Down
2 changes: 1 addition & 1 deletion modules/packages/HDFS.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ HDFS Support Types and Functions
*/
module HDFS {

use IO, OS.POSIX, SysError, Sys;
use IO, OS.POSIX, SysError;
public use CTypes;
import SysBasic.{syserr,ENOERR,EEOF};

Expand Down
Loading

0 comments on commit 04da6a5

Please sign in to comment.