Skip to content

Commit b247c2b

Browse files

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

libc-test/semver/linux-gnu.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,7 @@ STA_PPSTIME
448448
STA_PPSWANDER
449449
STA_RONLY
450450
STA_UNSYNC
451+
SUN_LEN
451452
ST_RELATIME
452453
SYSFS_MAGIC
453454
TCA_CHAIN

libc-test/semver/linux-musl.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ RWF_DSYNC
3636
RWF_HIPRI
3737
RWF_NOWAIT
3838
RWF_SYNC
39+
SUN_LEN
3940
USER_PROCESS
4041
_CS_V6_ENV
4142
_CS_V7_ENV

src/unix/linux_like/linux/mod.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6053,6 +6053,17 @@ f! {
60536053
pub fn ELF64_R_INFO(sym: Elf64_Xword, t: Elf64_Xword) -> Elf64_Xword {
60546054
sym << 32 + t
60556055
}
6056+
6057+
#[cfg(target_env = "gnu")]
6058+
pub fn SUN_LEN(s: crate::sockaddr_un) -> usize {
6059+
core::mem::offset_of!(crate::sockaddr_un, sun_path) +
6060+
unsafe { crate::strlen(s.sun_path.as_ptr()) }
6061+
}
6062+
6063+
#[cfg(target_env = "musl")]
6064+
pub fn SUN_LEN(s: crate::sockaddr_un) -> usize {
6065+
unsafe { crate::strlen(s.sun_path.as_ptr()) } * 2
6066+
}
60566067
}
60576068

60586069
safe_f! {

0 commit comments

Comments
 (0)