ADD_SUBDIRECTORY(src/dbus-activation-stop-test)
ADD_SUBDIRECTORY(src/dbus-send-receive-test)
ADD_SUBDIRECTORY(src/dbus-policy-two-wellknownname-per-one-connection-test)
+ADD_SUBDIRECTORY(src/glibc-api-test)
###############################################################################
+%package -n glibc-api-test
+Summary: glibc api test programs
+
+%description -n glibc-api-test
+This package provides glibc api test program
+
+
+###############################################################################
%prep
%setup -q
###############################################################################
+%files -n glibc-api-test
+%license LICENSE.Apache-2.0
+%manifest session-utils.manifest
+%{_bindir}/putenv-test
+
+###############################################################################
%files -n g-debug-fatal-warnings
%license LICENSE.Apache-2.0
%manifest session-utils.manifest
--- /dev/null
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+PROJECT(glibc-api-test C)
+
+INCLUDE(FindPkgConfig)
+pkg_check_modules(pkgs REQUIRED
+)
+
+FOREACH(flag ${pkgs_CFLAGS})
+ SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} ${flag}")
+ENDFOREACH(flag)
+
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIE")
+
+ADD_EXECUTABLE(putenv-test putenv-test.c)
+TARGET_LINK_LIBRARIES(putenv-test ${pkgs_LDFLAGS} -pie)
+
+INSTALL(TARGETS putenv-test DESTINATION bin
+ PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
+ GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
--- /dev/null
+/*
+ * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the License);
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+
+#include <stdio.h>
+#include <unistd.h>
+#include <stdlib.h>
+
+int main ()
+{
+ char buf[] = "AAA=aaa";
+
+ printf ("putenv(%s) result = %d\n", buf, putenv(buf));
+
+ buf[4] = 'b';
+ buf[5] = 'b';
+ buf[6] = 'b';
+
+ printf("AAA=%s\n", getenv("AAA"));
+}