bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug#187391: PortingIssues sockaddr_un


From: Ognyan Kulev
Subject: Re: Bug#187391: PortingIssues sockaddr_un
Date: Tue, 22 Apr 2003 14:47:01 +0300
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.3b) Gecko/20030408 Minotaur/0.1a

Robert Millan wrote:
ok, i think i understand it now. please could you look at [1] and
make sure it's correct now? i'd say that:

- the third line (i wrote) is wrong
- the second line _should_ work on GNU, hence we have a bug in gcc

I didn't understand what lines you refer to. I think "the second line" is about

struct sockaddr_un sun = { AF_LOCAL, "/path/to/socket" };

This can be a bug in G++, but it's bug in the program too because in BSDs you have one more field: sun_len (before sun_family), and this code will fail to compile too. The portable solution is to not use such initialization because you aren't sure what fields are in struct sockaddr_un.

- the non-GLIBC example should use strncpy

There is a question whether we should include _portability_ issues in our _porting_ page. If we do, then we have to include example using strncpy.

Regards
--
Ognyan Kulev <ogi@fmi.uni-sofia.bg>, "\"Programmer\""





reply via email to

[Prev in Thread] Current Thread [Next in Thread]