# define TEST_SYSCALL_NR __NR_fstatat64
# define TEST_SYSCALL_STR "fstatat64"
+# if defined __GLIBC__ && defined __sparc__ && defined __arch64__
+# define TEST_BOGUS_STRUCT_STAT 0
+# endif
# include "fstatat.c"
#else
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#define IS_FSTAT 1
#define TEST_SYSCALL_INVOKE(sample, pst) \
syscall(TEST_SYSCALL_NR, 0, pst)
#define PRINT_SYSCALL_HEADER(sample) \
# Check decoding of stat family syscalls.
. "${srcdir=.}/init.sh"
-run_strace_match_diff -v -P $NAME.sample
+run_strace_match_diff -v -P $NAME.sample -P /dev/full -a32
# endif /* HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC */
# endif
+# ifndef TEST_BOGUS_STRUCT_STAT
+# define TEST_BOGUS_STRUCT_STAT 1
+# endif
+
+# ifndef IS_FSTAT
+# define IS_STAT 0
+# endif
+
static void
print_ftype(const unsigned int mode)
{
int
main(void)
{
+# if !IS_FSTAT
+ static const char full[] = "/dev/full";
+# endif
static const char sample[] = TEST_SYSCALL_STR ".sample";
STRUCT_STAT st[2];
- int rc = create_sample(sample, SAMPLE_SIZE);
+ int rc;
+
+ rc = create_sample(sample, SAMPLE_SIZE);
if (rc) {
(void) unlink(sample);
return rc;
}
+# if TEST_BOGUS_STRUCT_STAT
+ STRUCT_STAT *st_cut = tail_alloc(sizeof(long) * 4);
+ rc = TEST_SYSCALL_INVOKE(sample, st_cut);
+ PRINT_SYSCALL_HEADER(sample);
+ printf("%p", st_cut);
+ PRINT_SYSCALL_FOOTER(rc);
+# endif
+
+# if !IS_FSTAT
+ rc = TEST_SYSCALL_INVOKE(full, st);
+ PRINT_SYSCALL_HEADER(full);
+ if (rc)
+ printf("%p", st);
+ else
+ print_stat(st);
+ PRINT_SYSCALL_FOOTER(rc);
+# endif
+
if ((rc = TEST_SYSCALL_INVOKE(sample, st))) {
perror(TEST_SYSCALL_STR);
(void) unlink(sample);