Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Message-ID: <3C567E1E.7BD31B1E@synaps-ing.de>
Date: Tue, 29 Jan 2002 11:49:02 +0100
From: Jan Kellmer <j.kellmer@synaps-ing.de>
Organization: Synaps Ingenieur-Gesellschaft mbH
X-Mailer: Mozilla 4.61 [en] (X11; I; Linux 2.2.10 i686)
X-Accept-Language: en
MIME-Version: 1.0
To: cygwin@cygwin.com
Subject: getdomainname trouble on Win2K/cygwin 1.3.9
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hello!

I'm running Win2K(SP2) German edition and have a problem with the
"getdomainname()" function.

I have tracked it down to the following example:
-- snip -- snap --
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

int main(int argc, char** argv) {
        char buffer[100];
        int result=getdomainname(buffer, 100);

        if(result<0)
                perror("getdomainname");
        fprintf(stderr, "domainname: '%s'\nResult: '%d'\n",
                buffer, result);
        return 0;
}
-- snap -- snip --

Even with administrator privileges, all I get is this:
-- snip -- snap --
getdomainname: Permission denied
domainname: ''
Result: '-1'

-- snap -- snip --

with the following cygwin:
-- snip -- snap --
$ uname -a
CYGWIN_NT-5.0 DIJKSTRA 1.3.9(0.51/3/2) 2002-01-21 12:48 i686 unknown
-- snap -- snip --


According to manual pages on Linux, HPUX and Irix, getdomainname() does
not produce an EPERM error. Even if there is no domain set, it should
return without error.


Is it me, the manual pages, or an error in cygwin?


Best regards,
    Jan

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

