2007-07-01 01:05:44 +08:00
|
|
|
/****************************************************************************
|
2016-08-07 22:25:30 +08:00
|
|
|
* sched/environ/env_getenvironptr.c
|
2007-07-01 01:05:44 +08:00
|
|
|
*
|
2024-09-11 19:45:11 +08:00
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*
|
2021-02-08 23:33:58 +08:00
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed with
|
|
|
|
* this work for additional information regarding copyright ownership. The
|
|
|
|
* ASF licenses this file to you 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
|
2007-07-01 01:05:44 +08:00
|
|
|
*
|
2021-02-08 23:33:58 +08:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2007-07-01 01:05:44 +08:00
|
|
|
*
|
2021-02-08 23:33:58 +08:00
|
|
|
* 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.
|
2007-07-01 01:05:44 +08:00
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Included Files
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#include <nuttx/config.h>
|
|
|
|
|
|
|
|
#ifndef CONFIG_DISABLE_ENVIRON
|
|
|
|
|
|
|
|
#include <sched.h>
|
|
|
|
#include <stdlib.h>
|
2014-08-09 07:53:55 +08:00
|
|
|
#include "sched/sched.h"
|
2007-07-01 01:05:44 +08:00
|
|
|
|
|
|
|
#undef get_environ_ptr
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Public Functions
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
2012-07-15 03:30:31 +08:00
|
|
|
* Name: get_environ_ptr
|
2007-07-01 01:05:44 +08:00
|
|
|
*
|
|
|
|
* Description:
|
|
|
|
* Return a pointer to the thread specific environ variable.
|
|
|
|
*
|
2018-03-13 23:52:27 +08:00
|
|
|
* Input Parameters:
|
2007-07-01 01:05:44 +08:00
|
|
|
* None
|
|
|
|
*
|
2018-02-02 00:00:02 +08:00
|
|
|
* Returned Value:
|
2007-07-01 01:05:44 +08:00
|
|
|
* A pointer to the per-thread environ variable.
|
|
|
|
*
|
|
|
|
* Assumptions:
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
2015-10-08 09:59:14 +08:00
|
|
|
FAR char **get_environ_ptr(void)
|
2007-07-01 01:05:44 +08:00
|
|
|
{
|
2022-04-16 19:38:17 +08:00
|
|
|
FAR struct tcb_s *tcb = this_task();
|
2008-01-28 22:59:21 +08:00
|
|
|
|
2022-04-16 19:38:17 +08:00
|
|
|
return tcb->group->tg_envp;
|
2007-07-01 01:05:44 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* CONFIG_DISABLE_ENVIRON */
|