Source
217
217
return do_utimes(AT_FDCWD, filename, times ? tv : NULL, 0);
218
218
}
219
219
#endif
220
220
221
221
#ifdef CONFIG_COMPAT_32BIT_TIME
222
222
/*
223
223
* Not all architectures have sys_utime, so implement this in terms
224
224
* of sys_utimes.
225
225
*/
226
226
#ifdef __ARCH_WANT_SYS_UTIME32
227
-
COMPAT_SYSCALL_DEFINE2(utime, const char __user *, filename,
228
-
struct old_utimbuf32 __user *, t)
227
+
SYSCALL_DEFINE2(utime32, const char __user *, filename,
228
+
struct old_utimbuf32 __user *, t)
229
229
{
230
230
struct timespec64 tv[2];
231
231
232
232
if (t) {
233
233
if (get_user(tv[0].tv_sec, &t->actime) ||
234
234
get_user(tv[1].tv_sec, &t->modtime))
235
235
return -EFAULT;
236
236
tv[0].tv_nsec = 0;
237
237
tv[1].tv_nsec = 0;
238
238
}
239
239
return do_utimes(AT_FDCWD, filename, t ? tv : NULL, 0);
240
240
}
241
241
#endif
242
242
243
-
COMPAT_SYSCALL_DEFINE4(utimensat, unsigned int, dfd, const char __user *, filename, struct old_timespec32 __user *, t, int, flags)
243
+
SYSCALL_DEFINE4(utimensat_time32, unsigned int, dfd, const char __user *, filename, struct old_timespec32 __user *, t, int, flags)
244
244
{
245
245
struct timespec64 tv[2];
246
246
247
247
if (t) {
248
248
if (get_old_timespec32(&tv[0], &t[0]) ||
249
249
get_old_timespec32(&tv[1], &t[1]))
250
250
return -EFAULT;
251
251
252
252
if (tv[0].tv_nsec == UTIME_OMIT && tv[1].tv_nsec == UTIME_OMIT)
253
253
return 0;
269
269
return -EFAULT;
270
270
if (tv[0].tv_nsec >= 1000000 || tv[0].tv_nsec < 0 ||
271
271
tv[1].tv_nsec >= 1000000 || tv[1].tv_nsec < 0)
272
272
return -EINVAL;
273
273
tv[0].tv_nsec *= 1000;
274
274
tv[1].tv_nsec *= 1000;
275
275
}
276
276
return do_utimes(dfd, filename, t ? tv : NULL, 0);
277
277
}
278
278
279
-
COMPAT_SYSCALL_DEFINE3(futimesat, unsigned int, dfd,
279
+
SYSCALL_DEFINE3(futimesat_time32, unsigned int, dfd,
280
280
const char __user *, filename,
281
281
struct old_timeval32 __user *, t)
282
282
{
283
283
return do_compat_futimesat(dfd, filename, t);
284
284
}
285
285
286
-
COMPAT_SYSCALL_DEFINE2(utimes, const char __user *, filename, struct old_timeval32 __user *, t)
286
+
SYSCALL_DEFINE2(utimes_time32, const char __user *, filename, struct old_timeval32 __user *, t)
287
287
{
288
288
return do_compat_futimesat(AT_FDCWD, filename, t);
289
289
}
290
290
#endif
291
291
#endif