delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/08/12/08:10:54

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT sourceware DOT cygnus DOT com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sourceware DOT cygnus DOT com>
List-Help: <mailto:cygwin-help AT sourceware DOT cygnus DOT com>,
<http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
From: "John Fralinger"<fralinjh AT dca DOT net>
Reply-to: fralinjh AT dca DOT net
To: cygwin AT sourceware DOT cygnus DOT com
Date: Thu, 12 Aug 1999 08:08:18 est
Subject: Problem with Simultaneous file access with JNI AND CYGWIN DLL only
Message-id: <37b2b932.6f43.0@dca.net>
X-User-Info: 206.241.18.4

I have some more info on the following.  The Makefile
must be Makefile.cyg to demonstrate the problem!!!
The Mingw make works as expected.  It appears as if 
the cygwin dll may do something different when the
uid is not accessible.  ( getuid from a JNI returns
ffff )

Using Makfile.nocyg works as one would expect.

----- Original Message ----- 
From: John Fralinger <fralinjh AT dca DOT net>
To: <cygwin AT sourceware DOT cygnus DOT com>
Sent: Tuesday, August 10, 1999 11:52 AM
Subject: Simultaneous open of same file under JNI


The following code demonstrates where System V shared memory
is breaking.

It uses Mumit Khan's JNI example environment.

#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <fcntl.h>
#include <jni.h>
#include "HelloWorld.h"

JNIEXPORT void JNICALL 
Java_HelloWorld_displayHelloWorld (JNIEnv *env, jobject obj) 
{
  char *home;
  int fd;
  char resp[256];

  printf("Java JNI\n");
  home = getenv ("HOME");
  printf("HOME = %s\n", (home) ? home : "(NULL)");
  printf("Enter any existing file name (complete path) to open\n");
  gets( resp );
  if ( ( fd = open( resp, O_RDWR ) ) == -1 )
  perror( "open failed" );
  printf("Run again from another window BEFORE Enter to exit\n");
  printf("(Use the same file name to demonstrate problem)\n");
  gets( resp );
  return;
}

Shouldn't this work the same way when called from JNI????
When I run 2 of these to the same file I get Permission denied!

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


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