1c16361c4SAxel Dörfler /* 2c16361c4SAxel Dörfler * Copyright 2015, Axel Dörfler, axeld@pinc-software.de. 3c16361c4SAxel Dörfler * Distributed under the terms of the MIT License. 4c16361c4SAxel Dörfler */ 5c16361c4SAxel Dörfler 6c16361c4SAxel Dörfler 7c16361c4SAxel Dörfler //! Empty main temporary directory 8c16361c4SAxel Dörfler 9c16361c4SAxel Dörfler 100caf909cSAugustin Cavalier #include <fs_volume.h> 110caf909cSAugustin Cavalier 12c16361c4SAxel Dörfler #include "InitSharedMemoryDirectoryJob.h" 13c16361c4SAxel Dörfler 14c16361c4SAxel Dörfler InitSharedMemoryDirectoryJob()15c16361c4SAxel DörflerInitSharedMemoryDirectoryJob::InitSharedMemoryDirectoryJob() 16c16361c4SAxel Dörfler : 17c16361c4SAxel Dörfler AbstractEmptyDirectoryJob("init /var/shared_memory") 18c16361c4SAxel Dörfler { 19c16361c4SAxel Dörfler } 20c16361c4SAxel Dörfler 21c16361c4SAxel Dörfler 22c16361c4SAxel Dörfler status_t Execute()23c16361c4SAxel DörflerInitSharedMemoryDirectoryJob::Execute() 24c16361c4SAxel Dörfler { 250caf909cSAugustin Cavalier status_t status = CreateAndEmpty("/var/shared_memory"); 260caf909cSAugustin Cavalier if (status != B_OK) 270caf909cSAugustin Cavalier return status; 280caf909cSAugustin Cavalier 290caf909cSAugustin Cavalier status = fs_mount_volume("/var/shared_memory", NULL, "ramfs", 0, NULL); 300caf909cSAugustin Cavalier if (status < B_OK) 310caf909cSAugustin Cavalier return status; 32*ae302bcfSAugustin Cavalier 33*ae302bcfSAugustin Cavalier chmod("/var/shared_memory", 0777); 340caf909cSAugustin Cavalier return B_OK; 35c16361c4SAxel Dörfler } 36