~ubuntu-branches/ubuntu/precise/eglibc/precise

« back to all changes in this revision

Viewing changes to sysdeps/unix/sysv/linux/fallocate64.c

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2011-10-04 17:48:26 UTC
  • mfrom: (216.1.23 oneiric)
  • Revision ID: package-import@ubuntu.com-20111004174826-2cyb9ewn3ucymlsx
Tags: 2.13-20ubuntu5
libc6-dev: Don't break the current {gnat,gcj}-4.4-base versons. LP: #853688.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (C) 2007, 2009, 2011 Free Software Foundation, Inc.
 
1
/* Copyright (C) 2007, 2009 Free Software Foundation, Inc.
2
2
   This file is part of the GNU C Library.
3
3
 
4
4
   The GNU C Library is free software; you can redistribute it and/or
18
18
 
19
19
#include <errno.h>
20
20
#include <fcntl.h>
21
 
#include <sysdep-cancel.h>
 
21
#include <sysdep.h>
22
22
 
23
23
 
24
24
/* Reserve storage for the data of the file associated with FD.  */
26
26
fallocate64 (int fd, int mode, __off64_t offset, __off64_t len)
27
27
{
28
28
#ifdef __NR_fallocate
29
 
  if (SINGLE_THREAD_P)
30
 
    return INLINE_SYSCALL (fallocate, 6, fd, mode,
31
 
                           __LONG_LONG_PAIR ((long int) (offset >> 32),
32
 
                                             (long int) offset),
33
 
                           __LONG_LONG_PAIR ((long int) (len >> 32),
34
 
                                             (long int) len));
35
 
 
36
 
  int result;
37
 
  int oldtype = LIBC_CANCEL_ASYNC ();
38
 
 
39
 
  result = INLINE_SYSCALL (fallocate, 6, fd, mode,
40
 
                           __LONG_LONG_PAIR ((long int) (offset >> 32),
41
 
                                             (long int) offset),
42
 
                           __LONG_LONG_PAIR ((long int) (len >> 32),
43
 
                                             (long int) len));
44
 
 
45
 
  LIBC_CANCEL_RESET (oldtype);
46
 
 
47
 
  return result;
 
29
  return INLINE_SYSCALL (fallocate, 6, fd, mode,
 
30
                         __LONG_LONG_PAIR ((long int) (offset >> 32),
 
31
                                           (long int) offset),
 
32
                         __LONG_LONG_PAIR ((long int) (len >> 32),
 
33
                                           (long int) len));
48
34
#else
49
35
  __set_errno (ENOSYS);
50
36
  return -1;