| Summary: | setsockopt warning with srun | ||
|---|---|---|---|
| Product: | Slurm | Reporter: | Nicolas Joly <njoly> |
| Component: | Other | Assignee: | David Bigagli <david> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | 6 - No support contract | ||
| Priority: | --- | CC: | brian, da |
| Version: | 14.11.x | ||
| Hardware: | Other | ||
| OS: | Other | ||
| Site: | -Other- | Slinky Site: | --- |
| Alineos Sites: | --- | Atos/Eviden Sites: | --- |
| Confidential Site: | --- | Coreweave sites: | --- |
| Cray Sites: | --- | DS9 clusters: | --- |
| Google sites: | --- | HPCnow Sites: | --- |
| HPE Sites: | --- | IBM Sites: | --- |
| NOAA SIte: | --- | NoveTech Sites: | --- |
| Nvidia HWinf-CS Sites: | --- | OCF Sites: | --- |
| Recursion Pharma Sites: | --- | SFW Sites: | --- |
| SNIC sites: | --- | Tzag Elita Sites: | --- |
| Linux Distro: | --- | Machine Name: | |
| CLE Version: | Version Fixed: | 14.11.0rc2 | |
| Target Release: | --- | DevPrio: | --- |
| Emory-Cloud Sites: | --- | ||
| Attachments: | setsockopt portability fix | ||
|
Description
Nicolas Joly
2014-10-09 00:43:04 MDT
Hi, yes you are right it should be 4 bytes, but the type instead of int should be socklen_t as per man page. David Fixed thanks. Commit fafe6f6bc324a. David (In reply to David Bigagli from comment #1) > Hi, Hi David, > yes you are right it should be 4 bytes, but the type instead of int should > be socklen_t as per man page. I disagree, setsockopt(sock, SOL_SOCKET, SO_RCVLOWAT, &size, sizeof(size)) The last argument "sizeof(size)" should indeed be of type socklen_t, but not the size variable itself which must remain of "int" type. Thanks.
sizeof(int) = sizeof(socklen_t) on the plaforms of interest.
The code then should be:
extern int net_set_low_water(int sock, int size);
if (setsockopt(sock, SOL_SOCKET, SO_RCVLOWAT,
(const void *) &size, sizeof(socklen_t)) < 0) {
to be 100% conformant, yet going to break if sizeof(int) != sizeof(socklen_t). :-)
David
|