• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Calling fcntl() and friends from Swift?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Calling fcntl() and friends from Swift?


  • Subject: Re: Calling fcntl() and friends from Swift?
  • From: Roland King <email@hidden>
  • Date: Sat, 18 Oct 2014 17:34:13 +0800

> On 18 Oct 2014, at 5:25 pm, Rick Mann <email@hidden> 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
> email@hidden
>

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 (email@hidden)

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:

This email sent to email@hidden


References: 
 >Calling fcntl() and friends from Swift? (From: Rick Mann <email@hidden>)

  • Prev by Date: Re: Table of TextViews
  • Next by Date: DOMDocument in 10.10
  • Previous by thread: Calling fcntl() and friends from Swift?
  • Next by thread: DOMDocument in 10.10
  • Index(es):
    • Date
    • Thread