home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Geek Gadgets 1
/
ADE-1.bin
/
ade-dist
/
kaffe-0.5p4-src.tgz
/
tar.out
/
contrib
/
kaffe
/
lib
/
native
/
java.io
/
FileDescriptor.c
< prev
next >
Wrap
C/C++ Source or Header
|
1996-09-28
|
925b
|
41 lines
/*
* java.io.FileDescriptor.c
*
* Copyright (c) 1996 Systems Architecture Research Centre,
* City University, London, UK.
*
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
* Written by Tim Wilkinson <tim@sarc.city.ac.uk>, February 1996.
*/
#include <stdio.h>
#include <assert.h>
#include "java.io.stubs/FileDescriptor.h"
#include "kthread.h"
/*
* Initialise a file descriptor to the given file nr.
*/
struct Hjava_io_FileDescriptor*
java_io_FileDescriptor_initSystemFD(struct Hjava_io_FileDescriptor* none, struct Hjava_io_FileDescriptor* this, jint i)
{
unhand(this)->fd = threadedFileDescriptor(i);
return (this);
}
/*
* Is this file descriptor valid ?
*/
jint /* bool */
java_io_FileDescriptor_valid(struct Hjava_io_FileDescriptor* this)
{
if (unhand(this)->fd >= 0) {
return (1);
}
else {
return (0);
}
}