1
1
/*
2
- * Copyright (c) 2020, 2024 , Oracle and/or its affiliates. All rights reserved.
2
+ * Copyright (c) 2020, 2025 , Oracle and/or its affiliates. All rights reserved.
3
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
4
*
5
5
* The Universal Permissive License (UPL), Version 1.0
@@ -729,7 +729,6 @@ private SelectableChannel[] getSelectableChannels(int[] fds) throws PosixExcepti
729
729
public long lseek (int fd , long offset , int how ,
730
730
@ Bind ("$node" ) Node inliningTarget ,
731
731
@ Exclusive @ Cached InlinedBranchProfile errorBranch ,
732
- @ Exclusive @ Cached InlinedConditionProfile notSupported ,
733
732
@ Exclusive @ Cached InlinedConditionProfile noFile ,
734
733
@ Exclusive @ Cached InlinedConditionProfile notSeekable ,
735
734
@ Shared ("eq" ) @ Cached TruffleString .EqualNode eqNode ) throws PosixException {
@@ -754,9 +753,6 @@ public long lseek(int fd, long offset, int how,
754
753
errorBranch .enter (inliningTarget );
755
754
throw posixException (OSErrorEnum .fromException (e , eqNode ));
756
755
}
757
- if (notSupported .profile (inliningTarget , newPos < 0 )) {
758
- throw createUnsupportedFeature ("cannot seek beyond the file size" );
759
- }
760
756
return newPos ;
761
757
}
762
758
@@ -779,8 +775,7 @@ private static long setPosition(long pos, int how, SeekableByteChannel fc) throw
779
775
throw new IllegalArgumentException ();
780
776
}
781
777
fc .position (newPos );
782
- long p = fc .position ();
783
- return p != newPos ? -1 : p ;
778
+ return fc .position ();
784
779
}
785
780
786
781
@ ExportMessage (name = "ftruncate" )
0 commit comments