delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/07/16/08:28:04

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
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Tue, 16 Jul 2002 07:29:27 -0500
From: "Jonathan E. Brickman" <jonathan DOT brickman AT gmx DOT net>
X-Priority: 3 (Normal)
Message-ID: <1792337422.20020716072927@gmx.net>
To: egor duda <cygwin AT cygwin DOT com>
Subject: Cannot find setgroups()?
In-Reply-To: <161269976.20020716103137@logos-m.ru>
References: <142458519 DOT 20020715174949 AT gmx DOT net>
<161269976 DOT 20020716103137 AT logos-m DOT ru>
MIME-Version: 1.0

JEB>> Obviously, when I #include <lmaccess.h>, the reported errors are in
JEB>> lmaccess.h. #including <lm.h> results in several files' errors. What
JEB>> am I doing wrong?

> Use #include <windows.h>, and then (if needed) #include <lm.h>

> Egor.            mailto:deo AT logos-m DOT ru ICQ 5165414 FidoNet 2:5020/496.19

Egor, thank you very much.  This worked perfectly.  But, now I have a
bigger problem.  My purpose for using <lmaccess.h> was for
setgroups().  And when I compile this code:

#include <unistd.h>
#include <windows.h>
#include <lm.h>
#include <lmaccess.h>

main() {
        gid_t group;
        group = 0;
        setgroups(1,&group);
        execl("/bin/sh","sh",NULL);
        }

I get this result:

$ gcc cygwinsetgroups.c -lnetapi32
/cygdrive/c/WINDOWS/TEMP/ccX0aNd7.o(.text+0x27):cygwinsetgroups.c:
undefined reference to `setgroups'
collect2: ld returned 1 exit status

The only .a file I was able to find containing 'setgroups' is
libnetapi32.a.  Help?

-- 
Jonathan E. Brickman    http://joshuacorps.org
Live forever.  If you don't know how, or aren't sure,
please ask, and I will tell you.


--
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