summaryrefslogtreecommitdiff
path: root/test/msan/getutent.cc
blob: 36f9e1f1f7e30213c1197b8acd2b3b9a98fc2723 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// RUN: %clangxx_msan -O0 -g %s -o %t && %run %t

#include <utmp.h>
#include <utmpx.h>
#include <sanitizer/msan_interface.h>

int main(void) {
  setutent();
  while (struct utmp *ut = getutent())
    __msan_check_mem_is_initialized(ut, sizeof(*ut));
  endutent();

  setutxent();
  while (struct utmpx *utx = getutxent())
    __msan_check_mem_is_initialized(utx, sizeof(*utx));
  endutxent();
}