Skip to content

Conversation

@wlan0
Copy link
Contributor

@wlan0 wlan0 commented Nov 18, 2025

This issue doesn't affect any of our existing products. This is a preemptive fix for downstream consumers of EXT4.format where, in some platforms, leading // in the path could get resolved into a FileTree that looks like this

/ 
 └──  / 
 └── usr

@wlan0 wlan0 requested review from dcantah and jglogan November 18, 2025 05:59
@wlan0 wlan0 force-pushed the main branch 2 times, most recently from 5dacd46 to 3d2676c Compare November 18, 2025 06:01
var cmsgBuf = [UInt8](repeating: 0, count: Int(CZ_CMSG_SPACE(Int(MemoryLayout<Int32>.size))))
msg.msg_control = withUnsafeMutablePointer(to: &cmsgBuf[0]) { UnsafeMutableRawPointer($0) }
msg.msg_controllen = socklen_t(cmsgBuf.count)
msg.msg_controllen = numericCast(cmsgBuf.count)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this change for? Looks to be causing a merge conflict as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

numericCast takes care of converting cmsgBuf.count (Int) to whatever type is expected by the platform

msg.msg_controllen is

  • socklen_t on macOS
  • size_t on Linux

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants