@@ -84,6 +84,10 @@ def self.to_nfi_type(type)
84
84
end
85
85
end
86
86
87
+ def self . varargs ( type )
88
+ :"...#{ to_nfi_type ( type ) } "
89
+ end
90
+
87
91
# the actual function is looked up and attached on its first call
88
92
def self . attach_function ( native_name , argument_types , return_type ,
89
93
library = LIBC , blocking = false , method_name = native_name , on = self )
@@ -184,7 +188,7 @@ def self.attach_function_eagerly(native_name, argument_types, return_type,
184
188
attach_function :dup2 , [ :int , :int ] , :int
185
189
attach_function :fchmod , [ :int , :mode_t ] , :int
186
190
attach_function :fchown , [ :int , :uid_t , :gid_t ] , :int
187
- attach_function :fcntl , [ :int , :int , :int ] , :int
191
+ attach_function :fcntl , [ :int , :int , varargs ( :int ) ] , :int
188
192
attach_function :flock , [ :int , :int ] , :int , LIBC , true
189
193
attach_function :truffleposix_fstat , [ :int , :pointer ] , :int , LIBTRUFFLEPOSIX
190
194
attach_function :truffleposix_fstat_mode , [ :int ] , :mode_t , LIBTRUFFLEPOSIX
@@ -207,7 +211,7 @@ def self.attach_function_eagerly(native_name, argument_types, return_type,
207
211
attach_function :truffleposix_minor , [ :dev_t ] , :uint , LIBTRUFFLEPOSIX
208
212
attach_function :mkdir , [ :string , :mode_t ] , :int
209
213
attach_function :mkfifo , [ :string , :mode_t ] , :int
210
- attach_function :open , [ :string , :int , :mode_t ] , :int
214
+ attach_function :open , [ :string , :int , varargs ( :mode_t ) ] , :int
211
215
attach_function :opendir , [ :string ] , :pointer
212
216
attach_function :pipe , [ :pointer ] , :int
213
217
attach_function :read , [ :int , :pointer , :size_t ] , :ssize_t , LIBC , true
0 commit comments