1 /* 2 * Copyright 2008, Haiku, Inc. All Rights Reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Axel Dörfler, axeld@pinc-software.de 7 */ 8 9 10 #include <unistd.h> 11 12 static const char* const kShells[] = { 13 "/bin/sh", 14 "/bin/bash", 15 NULL 16 }; 17 static int sShellIndex; 18 19 20 char * 21 getusershell(void) 22 { 23 if (kShells[sShellIndex] == NULL) 24 return NULL; 25 26 return (char*)kShells[sShellIndex++]; 27 } 28 29 30 void 31 endusershell(void) 32 { 33 sShellIndex = 0; 34 } 35 36 37 void 38 setusershell(void) 39 { 40 sShellIndex = 0; 41 } 42 43 44