summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThe Android Open Source Project2009-03-03 21:32:55 -0600
committerThe Android Open Source Project2009-03-03 21:32:55 -0600
commitdd7bc3319deb2b77c5d07a51b7d6cd7e11b5beb0 (patch)
tree2ba8d1a0846d69b18f623515e8d9b5d9fe38b590 /libcutils/socket_local.h
parente54eebbf1a908d65ee8cf80bab62821c05666d70 (diff)
downloadplatform-system-core-dd7bc3319deb2b77c5d07a51b7d6cd7e11b5beb0.tar.gz
platform-system-core-dd7bc3319deb2b77c5d07a51b7d6cd7e11b5beb0.tar.xz
platform-system-core-dd7bc3319deb2b77c5d07a51b7d6cd7e11b5beb0.zip
auto import from //depot/cupcake/@135843
Diffstat (limited to 'libcutils/socket_local.h')
-rw-r--r--libcutils/socket_local.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/libcutils/socket_local.h b/libcutils/socket_local.h
new file mode 100644
index 000000000..45b9856b6
--- /dev/null
+++ b/libcutils/socket_local.h
@@ -0,0 +1,39 @@
1/*
2 * Copyright (C) 2006 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef __SOCKET_LOCAL_H
18#define __SOCKET_LOCAL_H
19
20#define FILESYSTEM_SOCKET_PREFIX "/tmp/"
21#define ANDROID_RESERVED_SOCKET_PREFIX "/dev/socket/"
22
23/*
24 * Set up a given sockaddr_un, to have it refer to the given
25 * name in the given namespace. The namespace must be one
26 * of <code>ANDROID_SOCKET_NAMESPACE_ABSTRACT</code>,
27 * <code>ANDROID_SOCKET_NAMESPACE_RESERVED</code>, or
28 * <code>ANDROID_SOCKET_NAMESPACE_FILESYSTEM</code>. Upon success,
29 * the pointed at sockaddr_un is filled in and the pointed at
30 * socklen_t is set to indicate the final length. This function
31 * will fail if the namespace is invalid (not one of the indicated
32 * constants) or if the name is too long.
33 *
34 * @return 0 on success or -1 on failure
35 */
36int socket_make_sockaddr_un(const char *name, int namespaceId,
37 struct sockaddr_un *p_addr, socklen_t *alen);
38
39#endif