@JRubyMethod(meta = true, optional = 1) public static IRubyObject umask(ThreadContext context, IRubyObject recv, IRubyObject[] args) { Ruby runtime = context.runtime; int oldMask; if (args.length == 0) { oldMask = PosixShim.umask(runtime.getPosix()); } else if (args.length == 1) { int newMask = (int) args[0].convertToInteger().getLongValue(); oldMask = PosixShim.umask(runtime.getPosix(), newMask); } else { throw runtime.newArgumentError("wrong number of arguments"); } return runtime.newFixnum(oldMask); }
@JRubyMethod(meta = true, optional = 1) public static IRubyObject umask(ThreadContext context, IRubyObject recv, IRubyObject[] args) { Ruby runtime = context.runtime; int oldMask; if (args.length == 0) { oldMask = PosixShim.umask(runtime.getPosix()); } else if (args.length == 1) { int newMask = (int) args[0].convertToInteger().getLongValue(); oldMask = PosixShim.umask(runtime.getPosix(), newMask); } else { throw runtime.newArgumentError("wrong number of arguments"); } return runtime.newFixnum(oldMask); }
perm = perm & ~PosixShim.umask(posix);
perm = perm & ~PosixShim.umask(posix);