Thread overview | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
July 23, 2017 [Issue 17666] std.c.linux.socket has no replacement | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=17666 Harry Vennik <htvennik@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |htvennik@gmail.com --- Comment #1 from Harry Vennik <htvennik@gmail.com> --- TCP_* constants are defined in core.sys.linux.sys.netinet.tcp, and TCP_NODELAY also in core.sys.posix.netinet.tcp (uh, should that be in two places?). The other stuff is indeed nowhere to be found in druntime (except SD_* and IP_* in core.sys.windows.winsock2, which isn't relevant for Posix systems). -- |
July 23, 2017 [Issue 17666] std.c.linux.socket has no replacement | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=17666 Sebastiaan Koppe <mail@skoppe.eu> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED CC| |mail@skoppe.eu --- Comment #2 from Sebastiaan Koppe <mail@skoppe.eu> --- Just so that you know, I am working on a PR to add them to druntime. -- |
July 31, 2017 [Issue 17666] std.c.linux.socket has no replacement | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=17666 --- Comment #3 from Sebastiaan Koppe <mail@skoppe.eu> --- (In reply to Sebastiaan Koppe from comment #2) > Just so that you know, I am working on a PR to add them to druntime. I am a bit stuck on the issue. In src/core/sys/posix/netinet/in_.d there are 2 general sections, one for ipv4 and one for ipv6. In each section constants are defined for CRuntime_Glibc, Darwin, FreeBSD, NetBSD, Solaris and linux (in that order). Except there is no linux version for ipv6. Which makes me wonder how things for linux can actually compile, since basic things like in6_addr and sockaddr_in6 structures are not defined. I suppose the CRuntime_Glibc branch is taken, but that would be invalid since the constants differ slightly with linux. -- |
July 31, 2017 [Issue 17666] std.c.linux.socket has no replacement | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=17666 Sebastiaan Koppe <mail@skoppe.eu> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|nobody@puremagic.com |mail@skoppe.eu -- |
August 22, 2017 [Issue 17666] std.c.linux.socket has no replacement | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=17666 Jonathan M Davis <issues.dlang@jmdavisProg.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |issues.dlang@jmdavisProg.co | |m --- Comment #4 from Jonathan M Davis <issues.dlang@jmdavisProg.com> --- (In reply to Sebastiaan Koppe from comment #3) > (In reply to Sebastiaan Koppe from comment #2) > > Just so that you know, I am working on a PR to add them to druntime. > > I am a bit stuck on the issue. > > In src/core/sys/posix/netinet/in_.d there are 2 general sections, one for ipv4 and one for ipv6. In each section constants are defined for CRuntime_Glibc, Darwin, FreeBSD, NetBSD, Solaris and linux (in that order). Except there is no linux version for ipv6. > > Which makes me wonder how things for linux can actually compile, since basic things like in6_addr and sockaddr_in6 structures are not defined. > > I suppose the CRuntime_Glibc branch is taken, but that would be invalid since the constants differ slightly with linux. Well, AFAIK, basically every linux distro uses glibc, so CRuntime_Glibc is what would be used. It's Android that wouldn't use it, and I believe that it uses CRuntime_Bionic. The way that the IPv4 portion is a bit odd though, since it doesn't include CRuntime_Bionic, so I guess that Android would use the linux section in that case whereas any other linux would use CRuntime_Glibc. And in the IPv6 section, it uses CRuntime_Bionic instead of linux. So, I suspect that the fact that version(linux) is used in there at all is a bug, but I don't know. Regardless, for any normal linux system, both the IPv4 and IPv6 stuff is defined. -- |
August 22, 2017 [Issue 17666] std.c.linux.socket has no replacement | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=17666 --- Comment #5 from Jonathan M Davis <issues.dlang@jmdavisProg.com> --- druntime now has core.sys.freebsd.inet.in_, core.sys.linux.inet.in_, and core.sys.darwin.inet.in_ to conver all of the non-POSIX bindings from netinet/in.h. So, I think that this problem is _mostly_ solved (though unfortunately, it looks like it just missed making it into 2.076). I think that some of what's in std.c.linux.socket is from some other header files though, and some of that still needs to be added to druntime. IP_ADD_MEMBERSHIP is now there though. > Was it simply forgotten to be moved to druntime? > Or what's the story behind std.c.{linux,osx}.socket? I think that what happened is that since we don't put the OS bindings in Phobos anymore, it was decided that they should be deprecated, and no effort was made to verify whether everything that was defined there had actually been added to druntime yet or not. And AFAIK, no bug reports were opened about the missing symbols when someone did run into the problem, so the issue didn't get any attention, and it all just went under the radar. -- |
August 23, 2017 [Issue 17666] std.c.linux.socket has no replacement | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=17666 --- Comment #6 from Sebastiaan Koppe <mail@skoppe.eu> --- Ok, great. Whenever I get some time I will check core.sys.freebsd.inet.in_, core.sys.linux.inet.in_, and core.sys.darwin.inet.in_ to see if I see something missing, and add them in that case. -- |
August 23, 2017 [Issue 17666] std.c.linux.socket has no replacement | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=17666 --- Comment #7 from Jonathan M Davis <issues.dlang@jmdavisProg.com> --- (In reply to Sebastiaan Koppe from comment #6) > Ok, great. Whenever I get some time I will check core.sys.freebsd.inet.in_, core.sys.linux.inet.in_, and core.sys.darwin.inet.in_ to see if I see something missing, and add them in that case. I added basically everything that was in those header files except for declarations that were indicated by one of the systems to be deprecated or obsolete. So, while I certainly could have screwed up and missed something, and there may be some debate about a few of the items I intentionally skipped, I find it unlikely that anything that you care about will be missing. The bigger issue is the declarations in std.c.linux.socket which don't come from netinet/in.h, since that's the only header I've done anything for thus far. Most of what was in there was in netinet/in.h, but not all of it. -- |
August 31, 2017 [Issue 17666] std.c.linux.socket has no replacement | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=17666 --- Comment #8 from Sebastiaan Koppe <mail@skoppe.eu> --- Finally had some time to take a look. Pretty awesome. Thanks. But why in core.sys.linux.netinet.in_ is some stuff behind static if(__USE_MISC)? As far as I can tell that conditional evaluates to false, and there is a structure in there - ip_mreq - that I need. Also, the static if(__USE_MISC) at https://github.com/dlang/druntime/blob/master/src/core/sys/linux/netinet/in_.d#L168 is already inside a static if (__USE_MISC) conditional block. -- |
September 01, 2017 [Issue 17666] std.c.linux.socket has no replacement | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=17666 --- Comment #9 from Jonathan M Davis <issues.dlang@jmdavisProg.com> --- (In reply to Sebastiaan Koppe from comment #8) > Finally had some time to take a look. Pretty awesome. Thanks. > > But why in core.sys.linux.netinet.in_ is some stuff behind static if(__USE_MISC)? As far as I can tell that conditional evaluates to false, and there is a structure in there - ip_mreq - that I need. Unless I screwed it up, it follows what's defined in the header file. And yes, looking at core.sys.posix.config, it looks like it always evaluates to false. It needs either _BSD_SOURCE or _SVID_SOURCE to be true, but they're both false. I don't know whether that's correct or not. But if __USE_MISC is normally defined on a Linux system using glibc, then that implies that either how we're defining it is wrong or that we're doing the wrong thing with _BSD_SOURCE and/or _SVID_SOURCE. > Also, the static if(__USE_MISC) at > https://github.com/dlang/druntime/blob/master/src/core/sys/linux/netinet/in_. > d#L168 is already inside a static if (__USE_MISC) conditional block. That does look odd. Rechecking the file, it looks like I missed an #endif when reading it and thought that that section went longer than it did (braces with staci if are _so_ much better for figuring out when a section begins and ends). I've created a PR to fix it: https://github.com/dlang/druntime/pull/1911 That doesn't get you ip_mreq though. It's clearly in the __USE_MISC section. So, if we're going to have it, we need to figure out what the deal with __USE_MISC is and how we should be handling it such that it's true if it's true on Linux, but I really don't know anything about it. -- |
Copyright © 1999-2021 by the D Language Foundation