delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/01/29/04:52:42

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <3C567E1E.7BD31B1E@synaps-ing.de>
Date: Tue, 29 Jan 2002 11:49:02 +0100
From: Jan Kellmer <j DOT kellmer AT synaps-ing DOT 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 AT cygwin DOT com
Subject: getdomainname trouble on Win2K/cygwin 1.3.9

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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019