/*********************************************************
- * Copyright (c) 2007-2021,2023 VMware, Inc. All rights reserved.
+ * Copyright (c) 2007-2024 Broadcom. All Rights Reserved.
+ * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
#include "vm_atomic.h"
#include "util.h"
#include "hostType.h"
+#include "userlock.h"
#include "unicodeOperations.h"
#if !defined(_WIN32)
mode_t save;
+ static Atomic_Ptr lckStorage;
- save = umask(0);
+ /* Get and take lock to serial this routine. */
+ MXUserExclLock *lck = MXUser_CreateSingletonExclLock(&lckStorage,
+ "fileLockMakeDirectory",
+ RANK_LEAF);
+
+ MXUser_AcquireExclLock(lck);
+
+ save = umask(0); // Disable masking; save current value
#endif
ASSERT(pathName != NULL);
err = FileCreateDirectoryRobust(pathName, 0777);
#if !defined(_WIN32)
- umask(save);
+ umask(save); // Restore previous value
+
+ MXUser_ReleaseExclLock(lck);
#endif
return err;
/*********************************************************
- * Copyright (c) 1998-2020,2023 VMware, Inc. All rights reserved.
+ * Copyright (c) 1998-2024 Broadcom. All Rights Reserved.
+ * The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
Bool File_DoesVolumeSupportAcls(const char *pathName);
-Bool File_IsSubPathOf(const char *base, const char *path);
+Bool File_IsSubPathOf(const char *base,
+ const char *path);
Bool File_DoesVolumeSupportConvertBlocks(const char *pathName);