1*c9945492SAndroid Build Coastguard Worker #include <unistd.h>
2*c9945492SAndroid Build Coastguard Worker #include <crypt.h>
3*c9945492SAndroid Build Coastguard Worker
crypt(const char * key,const char * salt)4*c9945492SAndroid Build Coastguard Worker char *crypt(const char *key, const char *salt)
5*c9945492SAndroid Build Coastguard Worker {
6*c9945492SAndroid Build Coastguard Worker /* This buffer is sufficiently large for all
7*c9945492SAndroid Build Coastguard Worker * currently-supported hash types. It needs to be updated if
8*c9945492SAndroid Build Coastguard Worker * longer hashes are added. The cast to struct crypt_data * is
9*c9945492SAndroid Build Coastguard Worker * purely to meet the public API requirements of the crypt_r
10*c9945492SAndroid Build Coastguard Worker * function; the implementation of crypt_r uses the object
11*c9945492SAndroid Build Coastguard Worker * purely as a char buffer. */
12*c9945492SAndroid Build Coastguard Worker static char buf[128];
13*c9945492SAndroid Build Coastguard Worker return __crypt_r(key, salt, (struct crypt_data *)buf);
14*c9945492SAndroid Build Coastguard Worker }
15