Browse Source

posix: address some freebsd feedback

Laytan Laats 1 year ago
parent
commit
67ea7bb65a
2 changed files with 8 additions and 4 deletions
  1. 3 3
      core/sys/posix/fcntl.odin
  2. 5 1
      core/sys/posix/sys_socket.odin

+ 3 - 3
core/sys/posix/fcntl.odin

@@ -254,15 +254,15 @@ when ODIN_OS == .Darwin {
 	O_NONBLOCK :: 0x0004
 	O_SYNC     :: 0x0080
 	_O_RSYNC   :: 0
-	O_RSYNC    :: O_Flags{}
+	O_RSYNC    :: O_Flags{} // NOTE: not defined in headers
 
 	O_EXEC    :: 0x00040000
 	O_RDONLY  :: 0
 	O_RDWR    :: 0x0002
 	O_WRONLY  :: 0x0001
 
-	_O_SEARCH :: O_EXEC|O_DIRECTORY
-	O_SEARCH  :: O_Flags{ .EXEC, .DIRECTORY }
+	_O_SEARCH :: O_EXEC
+	O_SEARCH  :: O_Flags{ .EXEC }
 
 	AT_FDCWD: FD: -100
 

+ 5 - 1
core/sys/posix/sys_socket.odin

@@ -437,10 +437,14 @@ when ODIN_OS == .Darwin || ODIN_OS == .FreeBSD || ODIN_OS == .NetBSD || ODIN_OS
 	SO_SNDLOWAT   :: 0x1003
 	SO_TYPE       :: 0x1008
 
-	when ODIN_OS == .Darwin || ODIN_OS == .FreeBSD {
+	when ODIN_OS == .Darwin {
 		SO_LINGER   :: 0x1080
 		SO_RCVTIMEO :: 0x1006
 		SO_SNDTIMEO :: 0x1005
+	} else when ODIN_OS == .FreeBSD {
+		SO_LINGER   :: 0x0080
+		SO_RCVTIMEO :: 0x1006
+		SO_SNDTIMEO :: 0x1005
 	} else when ODIN_OS == .NetBSD {
 		SO_LINGER   :: 0x0080
 		SO_RCVTIMEO :: 0x100c