mirror of
				https://github.com/paboyle/Grid.git
				synced 2025-10-31 20:14:32 +00:00 
			
		
		
		
	Put a username in the path
This commit is contained in:
		| @@ -27,6 +27,7 @@ Author: Peter Boyle <paboyle@ph.ed.ac.uk> | |||||||
| /*  END LEGAL */ | /*  END LEGAL */ | ||||||
|  |  | ||||||
| #include <Grid/GridCore.h> | #include <Grid/GridCore.h> | ||||||
|  | #include <pwd.h> | ||||||
|  |  | ||||||
| namespace Grid {  | namespace Grid {  | ||||||
|  |  | ||||||
| @@ -288,7 +289,8 @@ void GlobalSharedMemory::SharedMemoryAllocate(uint64_t bytes, int flags) | |||||||
| 	 | 	 | ||||||
|       size_t size = bytes; |       size_t size = bytes; | ||||||
|        |        | ||||||
|       sprintf(shm_name,"/myGrid_mpi3_shm_%d_%d",WorldNode,r); |       struct passwd *pw = getpwuid (getuid()); | ||||||
|  |       sprintf(shm_name,"/Grid_%s_mpi3_shm_%d_%d",pw->pw_name,WorldNode,r); | ||||||
|        |        | ||||||
|       shm_unlink(shm_name); |       shm_unlink(shm_name); | ||||||
|       int fd=shm_open(shm_name,O_RDWR|O_CREAT,0666); |       int fd=shm_open(shm_name,O_RDWR|O_CREAT,0666); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user