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

« back to all changes in this revision

Viewing changes to ports/sysdeps/unix/sysv/linux/mips/mips64/n32/fallocate.c

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2012-02-08 01:58:09 UTC
  • mfrom: (1.5.3) (288.1.12 precise)
  • Revision ID: package-import@ubuntu.com-20120208015809-ulscst7uteq3e22z
Tags: 2.15~pre6-0ubuntu10
Merge from Debian (r5151, 2.13-26).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Copyright (C) 2007, 2009 Free Software Foundation, Inc.
 
1
/* Copyright (C) 2007, 2009, 2011 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.h>
 
21
#include <sysdep-cancel.h>
22
22
 
23
23
 
24
24
/* Reserve storage for the data of the file associated with FD.  */
26
26
fallocate (int fd, int mode, __off_t offset, __off_t len)
27
27
{
28
28
#ifdef __NR_fallocate
29
 
  return INLINE_SYSCALL (fallocate, 4, fd, mode, offset, len);
 
29
  if (SINGLE_THREAD_P)
 
30
    return INLINE_SYSCALL (fallocate, 4, fd, mode, offset, len);
 
31
 
 
32
  int result;
 
33
  int oldtype = LIBC_CANCEL_ASYNC ();
 
34
 
 
35
  result = INLINE_SYSCALL (fallocate, 4, fd, mode, offset, len);
 
36
 
 
37
  LIBC_CANCEL_RESET (oldtype);
 
38
 
 
39
  return result;
30
40
#else
31
41
  __set_errno (ENOSYS);
32
42
  return -1;