Cygwin: access: Fix X_OK behaviour for backup operators and admins
[newlib-cygwin.git] / newlib / libc / machine / riscv / sys / string.h
blobbeebe31f728f436f367f2e93e12632b0c8d83a1c
1 /* Copyright (c) 2017 SiFive Inc. All rights reserved.
3 This copyrighted material is made available to anyone wishing to use,
4 modify, copy, or redistribute it subject to the terms and conditions
5 of the FreeBSD License. This program is distributed in the hope that
6 it will be useful, but WITHOUT ANY WARRANTY expressed or implied,
7 including the implied warranties of MERCHANTABILITY or FITNESS FOR
8 A PARTICULAR PURPOSE. A copy of this license is available at
9 http://www.opensource.org/licenses.
12 #ifndef _SYS_STRING_H
13 #define _SYS_STRING_H
15 static __inline unsigned long __libc_detect_null(unsigned long w)
17 unsigned long mask = 0x7f7f7f7f;
18 if (sizeof (long) == 8)
19 mask = ((mask << 16) << 16) | mask;
20 return ~(((w & mask) + mask) | w | mask);
23 #endif