Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Ticket #261 (closed defect: fixed)

Opened 2 years ago

Last modified 1 year ago

O_NONBLOCK constant wrong... yet it was correct as well

Reported by: volcore Assigned to: kris
Priority: major Milestone: 0.99.1 RC4
Component: Tango Version:
Keywords: Cc:

Description

O_NONBLOCK octal in the official Linux header, not hex! Exists in Milestone 0.95 Beta 1 and Trunk.

--- tango/net/Socket.d (revision 1593) +++ tango/net/Socket.d (working copy) @@ -190,7 +190,7 @@

private const int F_GETFL = 3; private const int F_SETFL = 4;

- private const int O_NONBLOCK = 0x4000; + private const int O_NONBLOCK = 04000;

private const int SOL_SOCKET_D = 0xFFFF; private const int SO_TYPE = 0x1008;

Attachments

patch (490 bytes) - added by volcore on 02/03/07 20:19:10.
suggested patch

Change History

02/03/07 20:19:10 changed by volcore

  • attachment patch added.

suggested patch

02/03/07 21:04:07 changed by kris

  • status changed from new to closed.
  • resolution set to fixed.

thank you! Checked in

(follow-up: ↓ 3 ) 06/08/07 20:17:14 changed by volcore

  • status changed from closed to reopened.
  • resolution deleted.
  • summary changed from O_NONBLOCK constant wrong to O_NONBLOCK constant wrong... yet it was correct as well.

Just found out that the constant was actually correct ( 0x4000 ) for MacOS X. New patch suggestions (are there any other cases? Switch may be wrong. What does BSD say?):

Index: tango/tango/net/Socket.d =================================================================== --- tango/tango/net/Socket.d (revision 2288) +++ tango/tango/net/Socket.d (working copy) @@ -189,8 +189,9 @@

private const int F_GETFL = 3; private const int F_SETFL = 4;

- private const int O_NONBLOCK = 04000; // OCTAL! Thx to volcore - + version( Darwin ) private const int O_NONBLOCK = 0x4000; + else private const int O_NONBLOCK = 04000; +

extern (C)

{ socket_t socket(int af, int type, int protocol);

(in reply to: ↑ 2 ) 06/08/07 20:22:15 changed by volcore

The aforementioned may not be the proper value, as it was taken from the wrong header, I'll post it as soon as I have a working program with successfully nonblocking IO.

06/08/07 20:40:48 changed by volcore

Also, the "version( Darwin )" should actually be a "version( darwin )". The correct constant is 0x0004. It works now, altough I'm running into a lot of MacOS+Tango crash issues, so I can't verify this 100%.

08/13/07 14:46:27 changed by larsivi

  • milestone changed from 0.96 Beta 2 to 0.99.1 RC4.

What is the status of this with the latest release?

08/13/07 16:03:42 changed by Carlos

I assume this is working on Linux (or at least that someone can test it.) Is there a test case to check this on Mac OS X?

08/28/07 02:44:17 changed by kris

  • status changed from reopened to closed.
  • resolution set to fixed.

Darwin has been 0x0004 for a while now.

Thanks volcore :)