I learned how to initialize and load the property system and save it to the property file. Next I will learn about the Attribute Service. It is mainly used to provide a service for the upper layer of the Java Virtual Machine, or use java applications. The code for the start_property_service function is as follows:
#001 int start_property_service (void)
#002 {
#003 int fd;
#004
#005 load_properties_from_file (PROP_PATH_SYSTEM_BUILD );
#006 load_properties_from_file (PROP_PATH_SYSTEM_DEFAULT );
#007 load_properties_from_file (PROP_PATH_LOCAL_OVERRIDE );
This code is used to load the following default attribute files:
/System/build. prop
/System/default. prop
/Data/local. prop
#008/* Read persistent properties after all default values have been loaded .*/
#009 load_persistent_properties ();
This line of code is used to load attributes saved as attribute files.
#010
#011 fd = create_socket (PROP_SERVICE_NAME, SOCK_STREAM, 0666, 0, 0 );
#012 if (fd <0) return-1;
#013 fcntl (fd, F_SETFD, FD_CLOEXEC );
#014 fcntl (fd, F_SETFL, O_NONBLOCK );
This code is used to create a service socket and set the corresponding attributes.
#015
#016 listen (fd, 8 );
This line of code enables the property service to enter the listening status.
#017 return fd;
#018}