delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/08/25/17:37:47

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/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: Thu, 25 Aug 2005 23:37:35 +0200
From: Marcel Telka <marcel AT telka DOT sk>
To: cygwin AT cygwin DOT com
Subject: Re: 1.5.18 ( 0.132/4/2 ) - ioperm - OpenSCManager failed
Message-ID: <20050825213735.GA15212@tortuga.telka.sk>
References: <ILSQAS$678CF0EA0BF06586054016072C86B05F AT terra DOT com DOT br>
Mime-Version: 1.0
In-Reply-To: <ILSQAS$678CF0EA0BF06586054016072C86B05F@terra.com.br>
User-Agent: Mutt/1.4.2.1i
X-IsSubscribed: yes

Hi Douglas.

On Thu, Aug 25, 2005 at 05:59:16PM -0300, Douglas Schilling Landgraf wrote:
> Thanks Gerrit, I got how to compile my program reading "README" file ;o).
> It needs use -lioperm flag ( On Linux it's -O2 for ioperm functions ) .  
> 
> $ gcc -o io io.c -lioperm
> $./io
> Illegal instruction ( code dumped )
> 
> I don't know why it happens on Cygwin. On Linux the same code works fine ( below ).
> 
> Maybe permission ( I'm using Windows XP SP2 )? I'm looking for it.
> 
> #include <stdio.h>
> #include <stdlib.h>
> #include <string.h>
> #include <sys/io.h>
> 
> int main( void ) {
> 
> unsigned char Value;
> 
>     ioperm(0x378, 3, 1);

You should test return value from the ioperm() call.

>     Value = inb(0x378+1);
>     ioperm(0x378, 3, 0);
> 
>     printf("Status Parallel Port -> 0x%x\n", Value );
> 
> 	return 0;
> 
> }

Regards.

-- 
+-------------------------------------------+
| Marcel Telka   e-mail:   marcel AT telka DOT sk  |
|                homepage: http://telka.sk/ |
|                jabber:   marcel AT jabber DOT sk |
+-------------------------------------------+

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.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