> On 18 Oct 2014, at 5:25 pm, Rick Mann <rm...@latencyzero.com> wrote:
> 
> So far, my foray into Swift is going decently well. But I'm trying to 
> re-write some code that uses IOKit and <sys/fcntl.h>, and while the IOKit 
> calls are fine, it doesn't like me trying to call fcntl(). It says, "Use of 
> unresolved identifier 'fcntl'".
> 
> I've tried including <sys/fcntl.h> in my bridging header, I tried a few 
> imports like "import sys" or "import fcntl" with no luck. I also haven't 
> found anything by googling. Even searching for "Swift printf" didn't give me 
> good results.
> 
> Any ideas on how I can call these things? Thanks!
> 
> -- 
> Rick Mann
> rm...@latencyzero.com
> 

fcntl() wasn’t mapped in earlier versions of Swift, possibly still isn’t. If 
you can’t get to it with Darwin.fcntl() (and I don’t think you can) then you 
can’t get to it. 

You can wrap it in a piece of objc and export it via a bridging header .. which 
is pretty ugh. 

Bits of libdispatch were missing in earlier versions, I filed a bug against it 
and they eventually did show up. 
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to