- bzero(sb, sizeof(struct stat));
- sb->st_mode = pinfo->pshm_mode;
- sb->st_uid = pinfo->pshm_uid;
- sb->st_gid = pinfo->pshm_gid;
- sb->st_size = pinfo->pshm_length;
+#if CONFIG_MACF
+ error = mac_posixshm_check_stat(kauth_cred_get(), pinfo);
+ if (error) {
+ PSHM_SUBSYS_UNLOCK();
+ return(error);
+ }
+#endif
+
+ if (isstat64 != 0) {
+ sb64 = (struct stat64 *)ub;
+ bzero(sb64, sizeof(struct stat64));
+ sb64->st_mode = pinfo->pshm_mode;
+ sb64->st_uid = pinfo->pshm_uid;
+ sb64->st_gid = pinfo->pshm_gid;
+ sb64->st_size = pinfo->pshm_length;
+ } else {
+ sb = (struct stat *)ub;
+ bzero(sb, sizeof(struct stat));
+ sb->st_mode = pinfo->pshm_mode;
+ sb->st_uid = pinfo->pshm_uid;
+ sb->st_gid = pinfo->pshm_gid;
+ sb->st_size = pinfo->pshm_length;
+ }