Skip to content

Commit

Permalink
linux: move DCCP_ constants from linux/gnu to linux
Browse files Browse the repository at this point in the history
closes #3132

these constants come from linux headers, so they should be exposed for
"linux", not just glibc.

this change exposes them for linux/musl and linux/uclibc.

of note, android contains these same constants, but moving it to
linux-like would also expose them on emscripten, which does not have it.
  • Loading branch information
nekopsykose committed Mar 3, 2023
1 parent 2bafdcf commit b5c207a
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 38 deletions.
17 changes: 0 additions & 17 deletions libc-test/semver/linux-gnu.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,6 @@ CGROUP2_SUPER_MAGIC
CGROUP_SUPER_MAGIC
CODA_SUPER_MAGIC
CRAMFS_MAGIC
DCCP_SERVICE_LIST_MAX_LEN
DCCP_SOCKOPT_AVAILABLE_CCIDS
DCCP_SOCKOPT_CCID
DCCP_SOCKOPT_CCID_RX_INFO
DCCP_SOCKOPT_CCID_TX_INFO
DCCP_SOCKOPT_CHANGE_L
DCCP_SOCKOPT_CHANGE_R
DCCP_SOCKOPT_GET_CUR_MPS
DCCP_SOCKOPT_PACKET_SIZE
DCCP_SOCKOPT_QPOLICY_ID
DCCP_SOCKOPT_QPOLICY_TXQLEN
DCCP_SOCKOPT_RECV_CSCOV
DCCP_SOCKOPT_RX_CCID
DCCP_SOCKOPT_SEND_CSCOV
DCCP_SOCKOPT_SERVER_TIMEWAIT
DCCP_SOCKOPT_SERVICE
DCCP_SOCKOPT_TX_CCID
DEAD_PROCESS
DEBUGFS_MAGIC
DEVPTS_SUPER_MAGIC
Expand Down
17 changes: 17 additions & 0 deletions libc-test/semver/linux.txt
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,23 @@ DAY_4
DAY_5
DAY_6
DAY_7
DCCP_SERVICE_LIST_MAX_LEN
DCCP_SOCKOPT_AVAILABLE_CCIDS
DCCP_SOCKOPT_CCID
DCCP_SOCKOPT_CCID_RX_INFO
DCCP_SOCKOPT_CCID_TX_INFO
DCCP_SOCKOPT_CHANGE_L
DCCP_SOCKOPT_CHANGE_R
DCCP_SOCKOPT_GET_CUR_MPS
DCCP_SOCKOPT_PACKET_SIZE
DCCP_SOCKOPT_QPOLICY_ID
DCCP_SOCKOPT_QPOLICY_TXQLEN
DCCP_SOCKOPT_RECV_CSCOV
DCCP_SOCKOPT_RX_CCID
DCCP_SOCKOPT_SEND_CSCOV
DCCP_SOCKOPT_SERVER_TIMEWAIT
DCCP_SOCKOPT_SERVICE
DCCP_SOCKOPT_TX_CCID
DT_UNKNOWN
D_FMT
D_T_FMT
Expand Down
21 changes: 0 additions & 21 deletions src/unix/linux_like/linux/gnu/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -730,27 +730,6 @@ pub const PF_NFC: ::c_int = AF_NFC;
pub const PF_VSOCK: ::c_int = AF_VSOCK;
pub const PF_XDP: ::c_int = AF_XDP;

/* DCCP socket options */
pub const DCCP_SOCKOPT_PACKET_SIZE: ::c_int = 1;
pub const DCCP_SOCKOPT_SERVICE: ::c_int = 2;
pub const DCCP_SOCKOPT_CHANGE_L: ::c_int = 3;
pub const DCCP_SOCKOPT_CHANGE_R: ::c_int = 4;
pub const DCCP_SOCKOPT_GET_CUR_MPS: ::c_int = 5;
pub const DCCP_SOCKOPT_SERVER_TIMEWAIT: ::c_int = 6;
pub const DCCP_SOCKOPT_SEND_CSCOV: ::c_int = 10;
pub const DCCP_SOCKOPT_RECV_CSCOV: ::c_int = 11;
pub const DCCP_SOCKOPT_AVAILABLE_CCIDS: ::c_int = 12;
pub const DCCP_SOCKOPT_CCID: ::c_int = 13;
pub const DCCP_SOCKOPT_TX_CCID: ::c_int = 14;
pub const DCCP_SOCKOPT_RX_CCID: ::c_int = 15;
pub const DCCP_SOCKOPT_QPOLICY_ID: ::c_int = 16;
pub const DCCP_SOCKOPT_QPOLICY_TXQLEN: ::c_int = 17;
pub const DCCP_SOCKOPT_CCID_RX_INFO: ::c_int = 128;
pub const DCCP_SOCKOPT_CCID_TX_INFO: ::c_int = 192;

/// maximum number of services provided on the same listening port
pub const DCCP_SERVICE_LIST_MAX_LEN: ::c_int = 32;

pub const SIGEV_THREAD_ID: ::c_int = 4;

pub const BUFSIZ: ::c_uint = 8192;
Expand Down
21 changes: 21 additions & 0 deletions src/unix/linux_like/linux/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3788,6 +3788,27 @@ pub const SCTP_PR_SCTP_ALL: ::c_int = 1 << 7;
pub const SCTP_NOTIFICATION: ::c_int = MSG_NOTIFICATION;
pub const SCTP_EOF: ::c_int = ::MSG_FIN;

/* DCCP socket options */
pub const DCCP_SOCKOPT_PACKET_SIZE: ::c_int = 1;
pub const DCCP_SOCKOPT_SERVICE: ::c_int = 2;
pub const DCCP_SOCKOPT_CHANGE_L: ::c_int = 3;
pub const DCCP_SOCKOPT_CHANGE_R: ::c_int = 4;
pub const DCCP_SOCKOPT_GET_CUR_MPS: ::c_int = 5;
pub const DCCP_SOCKOPT_SERVER_TIMEWAIT: ::c_int = 6;
pub const DCCP_SOCKOPT_SEND_CSCOV: ::c_int = 10;
pub const DCCP_SOCKOPT_RECV_CSCOV: ::c_int = 11;
pub const DCCP_SOCKOPT_AVAILABLE_CCIDS: ::c_int = 12;
pub const DCCP_SOCKOPT_CCID: ::c_int = 13;
pub const DCCP_SOCKOPT_TX_CCID: ::c_int = 14;
pub const DCCP_SOCKOPT_RX_CCID: ::c_int = 15;
pub const DCCP_SOCKOPT_QPOLICY_ID: ::c_int = 16;
pub const DCCP_SOCKOPT_QPOLICY_TXQLEN: ::c_int = 17;
pub const DCCP_SOCKOPT_CCID_RX_INFO: ::c_int = 128;
pub const DCCP_SOCKOPT_CCID_TX_INFO: ::c_int = 192;

/// maximum number of services provided on the same listening port
pub const DCCP_SERVICE_LIST_MAX_LEN: ::c_int = 32;

f! {
pub fn NLA_ALIGN(len: ::c_int) -> ::c_int {
return ((len) + NLA_ALIGNTO - 1) & !(NLA_ALIGNTO - 1)
Expand Down

0 comments on commit b5c207a

Please sign in to comment.