NSMutableData +dataWithLength: sets errno?
NSMutableData +dataWithLength: sets errno?
- Subject: NSMutableData +dataWithLength: sets errno?
- From: Carl Hoefs <email@hidden>
- Date: Tue, 14 Mar 2017 16:00:11 -0700
macOS 10.12.3, Xcode 8.2.1, ObjC
I'm finding the following line to be problematic:
NSMutableData *myData = [NSMutableData dataWithLength:80];
I assume this ends up calling calloc(3) to allocate and zero out the data. But for some reason, it's always setting errno to a seemingly random nonzero value, generally either errno=2 (ENOENT) or errno=22 (EINVAL).
Now that I know it does this, I can make accommodations for it, but is this expected behavior?
-Carl
_______________________________________________
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