< prev index next >
src/solaris/classes/sun/nio/fs/LinuxNativeDispatcher.java
Print this page
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
@@ -52,19 +52,34 @@
throws UnixException;
/**
* int getmntent(FILE *fp, struct mnttab *mp, int len);
*/
- static native int getmntent(long fp, UnixMountEntry entry)
+
+ static int getmntent(long fp, UnixMountEntry entry, int buflen) throws UnixException {
+ NativeBuffer buffer = NativeBuffers.getNativeBuffer(buflen);
+ try {
+ return getmntent0(fp, entry, buffer.address(), buflen);
+ } finally {
+ buffer.release();
+ }
+ }
+
+ static native int getmntent0(long fp, UnixMountEntry entry, long buffer, int bufLen)
throws UnixException;
/**
* int endmntent(FILE* filep);
*/
static native void endmntent(long stream) throws UnixException;
/**
+ * ssize_t getline(char **lineptr, size_t *n, FILE *stream);
+ */
+ static native int getlinelen(long stream) throws UnixException;
+
+ /**
* ssize_t fgetxattr(int filedes, const char *name, void *value, size_t size);
*/
static int fgetxattr(int filedes, byte[] name, long valueAddress,
int valueLen) throws UnixException
{
< prev index next >