Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-1933] TIOCGWINSZ is not available via import of Darwin or Darwin.sys #44542

Closed
phausler opened this issue Jun 29, 2016 · 4 comments
Closed
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. SDKOverlay standard library Area: Standard library umbrella

Comments

@phausler
Copy link
Member

Previous ID SR-1933
Radar None
Original Reporter @phausler
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Standard Library
Labels Bug, SDKOverlay
Assignee uraimo (JIRA)
Priority Medium

md5: cb4b158c83606bdde57fc56480f32b3f

Issue Description:

I would expect the following code to compile. However it claims that TIOCGWINSZ is not a symbol.

import Darwin
var sz = winsize()
ioctl(fd, TIOCGWINSZ, &sz)

As a very ugly hack I have to work-around it via writing un-portable code like:

let TIOCGWINSZ = 0x40087468

There seems to be a number of stance omissions from nurses and other components; is this perhaps an importer failure?

@belkadan
Copy link
Contributor

Macros again. I think uraimo (JIRA User) was looking into adding them manually (see discussion in #2946

@swift-ci
Copy link
Collaborator

Comment by Umberto Raimondi (JIRA)

Yes, i'm preparing a PR with all the constants (ttycom, ioccom and a few other files), it should be ready today or tomorrow.

TIOCGWINSZ and other TIOC macros are not being imported because on Darwin those are nested macros (unsupported), if you try the same thing on Linux you'll notice that all the defines are imported correctly because they are instead statically defined with hex constants.

I considered importing them with a bridge function to keep them aligned with the current value of the macros but opted for static constants to reduce the clutter (hoping they will still not be modified for another few decades).

@swift-ci
Copy link
Collaborator

Comment by Umberto Raimondi (JIRA)

PR opened here: #3276

@swift-ci
Copy link
Collaborator

swift-ci commented Jul 2, 2016

Comment by Umberto Raimondi (JIRA)

Merged, those constants will be available on FreeBSD too.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. SDKOverlay standard library Area: Standard library umbrella
Projects
None yet
Development

No branches or pull requests

3 participants