• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  *
3  *   Copyright (c) Red Hat Inc., 2009
4  *
5  *   This program is free software;  you can redistribute it and/or modify
6  *   it under the terms of the GNU General Public License as published by
7  *   the Free Software Foundation; either version 2 of the License, or
8  *   (at your option) any later version.
9  *
10  *   This program is distributed in the hope that it will be useful,
11  *   but WITHOUT ANY WARRANTY;  without even the implied warranty of
12  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
13  *   the GNU General Public License for more details.
14  *
15  *   You should have received a copy of the GNU General Public License
16  *   along with this program;  if not, write to the Free Software
17  *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18  */
19 
20 /* Author: Masatake YAMATO <yamato@redhat.com> */
21 
22 #ifndef __COMPAT_UID_16_H__
23 #define __COMPAT_UID_16_H__
24 
25 #include <asm/posix_types.h>
26 #include "tst_common.h"
27 
28 #ifdef TST_USE_COMPAT16_SYSCALL
29 typedef __kernel_old_uid_t UID_T;
UID_SIZE_CHECK(uid_t uid)30 int UID_SIZE_CHECK(uid_t uid)
31 {
32 	/* See high2lowuid in linux/highuid.h
33 	   Return 0 if uid is too large to store
34 	   it to __kernel_old_uid_t. */
35 	return ((uid) & ~0xFFFF)? 0: 1;
36 }
37 
38 #else
39 
40 typedef uid_t UID_T;
UID_SIZE_CHECK(uid_t uid LTP_ATTRIBUTE_UNUSED)41 int UID_SIZE_CHECK(uid_t uid LTP_ATTRIBUTE_UNUSED)
42 {
43 	return 1;
44 }
45 
46 #endif
47 
48 #endif /* __SETUID_COMPAT_16_H__ */
49